#!/bin/bash

# omarchy:summary=Open HEY webmail and translate mailto links
# omarchy:args=[url]

url="$1"
web_url="https://app.hey.com"

# Handle mailto: URLs
if [[ $url =~ ^mailto: ]]; then
  email=$(echo "$url" | sed 's/mailto://')
  web_url="https://app.hey.com/messages/new?to=$email"
fi

exec omarchy-launch-webapp "$web_url"
