Cross-Channel Notify
Send a single notification through both email and iMessage with unified markdown formatting.
Prerequisites
- Email: Himalaya CLI configured (
himalaya --version). See references/channels.md for setup. - iMessage: BlueBubbles channel enabled in gateway config (
channels.bluebubbles).
Workflow
- Collect inputs:
to_email,to_imessage(E.164 or chat_guid),subject(email),body(markdown). - Format content: Run
scripts/format_message.shto apply the shared markdown template. This produces two outputs:email_body: full markdown (headers, bullet lists, signature block)imessage_body: compact plain-text (stripped markdown syntax, ≤2000 chars)
- Send email:
cat << 'EOF' | himalaya template send From: <sender> To: <to_email> Subject: <subject> <email_body> EOF - Send iMessage: Use the
messagetool withchannel: "bluebubbles",target: <to_imessage>,message: <imessage_body>. - Report: Confirm both sends or surface any failures.
Format Template
scripts/format_message.sh reads the body and applies:
- Title line (
## Notification) prepended - Timestamp line appended
- For email: keeps full markdown
- For iMessage: strips
#,**, bullet markers, and truncates to 2000 chars
Usage:
scripts/format_message.sh "Your message body here"
# Outputs two lines: EMAIL_BODY <tab> IMESSAGE_BODY
Channel Selection
Both channels are sent by default. To skip a channel:
- Email only: set
SKIP_IMESSAGE=1 - iMessage only: set
SKIP_EMAIL=1
SKIP_EMAIL=1 scripts/format_message.sh "Urgent: server down"
Error Handling
- If Himalaya send fails, log the error and continue to iMessage.
- If iMessage send fails, log the error and report partial failure.
- Always report which channels succeeded/failed.
