Messages Command

Send and manage email messages using the messages command.

Overview

ahasend messages [subcommand] [flags]
Available subcommands:
  • send - Send email messages
  • list - List sent messages
  • cancel - Cancel scheduled messages

Send Messages

Basic Usage

# Text email
ahasend messages send \
  --from [email protected] \
  --to [email protected] \
  --subject "Hello" \
  --text "Hello World"

# HTML email
ahasend messages send \
  --from [email protected] \
  --to [email protected] \
  --subject "Welcome" \
  --html "<h1>Welcome!</h1><p>Thank you for signing up.</p>"

Recipients

# Single recipient
ahasend messages send \
  --from [email protected] \
  --to [email protected] \
  --subject "Notification" \
  --text "Your order has been processed"

# Multiple recipients
ahasend messages send \
  --from [email protected] \
  --to [email protected] \
  --to [email protected] \
  --subject "Team Update" \
  --text "Important announcement"

# Batch from file
ahasend messages send \
  --from [email protected] \
  --recipients users.csv \
  --subject "Newsletter" \
  --html-template newsletter.html

Content Options

# With template
ahasend messages send \
  --from [email protected] \
  --to [email protected] \
  --subject "Welcome {{name}}" \
  --html-template welcome.html \
  --global-substitutions data.json

# With attachments
ahasend messages send \
  --from [email protected] \
  --to [email protected] \
  --subject "Invoice" \
  --text "Please find your invoice attached." \
  --attach invoice.pdf

# Scheduled delivery
ahasend messages send \
  --from [email protected] \
  --to [email protected] \
  --subject "Reminder" \
  --text "Meeting tomorrow at 2 PM" \
  --schedule "2024-12-25T14:00:00Z"

Testing

# Sandbox mode (no actual sending)
ahasend messages send \
  --from [email protected] \
  --to [email protected] \
  --subject "Test" \
  --text "Testing" \
  --sandbox

Key Flags

Recipients:
  • --to: Single recipient (can be used multiple times)
  • --recipients: CSV/JSON file with recipient data
Content:
  • --subject: Email subject
  • --text: Plain text content
  • --html: HTML content
  • --html-template: HTML template file
  • --text-template: Plain text template file
  • --global-substitutions: JSON file with template variables
Options:
  • --attach: File attachments (can be used multiple times)
  • --schedule: Delivery time (RFC3339 format)
  • --sandbox: Test mode without sending
  • --tags: Tags for categorization
  • --header: Custom headers
Batch Processing:
  • --max-concurrency: Parallel workers (1-10)
  • --progress: Show progress bar
  • --show-metrics: Display performance statistics

List Messages

# List recent messages
ahasend messages list

# With filters
ahasend messages list --limit 50 --status delivered

Cancel Messages

# Cancel scheduled message
ahasend messages cancel msg_1234567890abcdef

Advanced Usage

For detailed information on batch processing and templating:

Next Steps