getmailer-cli
v1.0.3
Published
CLI for GetMailer - Send transactional emails with ease
Maintainers
Readme
GetMailer CLI
Command-line interface for GetMailer - Send transactional emails with ease.
Installation
npm install -g getmailerQuick Start
Get your API key from getmailer.app/api-keys
Login with your API key:
getmailer login --key gm_your_api_key_hereSend your first email:
getmailer send \ --from "[email protected]" \ --to "[email protected]" \ --subject "Hello from GetMailer" \ --html "<h1>Hello World!</h1>"
Commands
Authentication
# Login with API key
getmailer login --key <api-key>
# Logout
getmailer logoutSending Emails
# Send a simple email
getmailer send \
-f [email protected] \
-t [email protected] \
-s "Subject" \
--html "<p>Hello!</p>"
# Send with HTML file
getmailer send \
-f [email protected] \
-t [email protected] \
-s "Newsletter" \
--html-file ./email.html
# Send using a template
getmailer send \
-f [email protected] \
-t [email protected] \
-s "Welcome" \
--template template_id \
--vars '{"name": "John"}'
# Send to multiple recipients
getmailer send \
-f [email protected] \
-t [email protected] [email protected] \
-s "Announcement" \
--html "<p>Important update!</p>"Batch Emails
# Create a batch job
getmailer batch create \
--name "Weekly Newsletter" \
--from [email protected] \
--subject "Weekly Update" \
--html-file ./newsletter.html \
--recipients ./recipients.json
# Recipients JSON format:
# [
# {"to": "[email protected]", "variables": {"name": "Alice"}},
# {"to": "[email protected]", "variables": {"name": "Bob"}}
# ]Email Management
# List sent emails
getmailer emails list
getmailer emails list --limit 50
# Get email details
getmailer emails get <email-id>Templates
# List templates
getmailer templates list
# Create a template
getmailer templates create \
--name "Welcome Email" \
--subject "Welcome, {{name}}!" \
--html "<h1>Hello {{name}}</h1><p>Welcome to our service!</p>"
# Create from file
getmailer templates create \
--name "Newsletter" \
--subject "Weekly Update" \
--html-file ./template.html
# Update a template
getmailer templates update <template-id> \
--subject "New Subject"
# Delete a template
getmailer templates delete <template-id>Domains
# List domains
getmailer domains list
# Add a domain (returns DNS records to configure)
getmailer domains add example.com
# Check verification status
getmailer domains verify <domain-id>
# Delete a domain
getmailer domains delete <domain-id>Webhooks
# List webhooks
getmailer webhooks list
# Create a webhook
getmailer webhooks create \
--url https://yourapp.com/webhook \
--events SENT DELIVERED OPENED BOUNCED
# Update a webhook
getmailer webhooks update <webhook-id> \
--events SENT DELIVERED \
--disable
# Delete a webhook
getmailer webhooks delete <webhook-id>Suppression List
# List suppressed emails
getmailer suppression list
# Add to suppression list
getmailer suppression add --emails [email protected] [email protected]
# Add from file
getmailer suppression add --file ./suppressed.txt
# Remove from suppression
getmailer suppression remove --emails [email protected]Analytics
# Get summary statistics
getmailer analytics
# Get daily statistics
getmailer analytics --type daily --days 30API Keys
# List API keys
getmailer keys list
# Create a new API key
getmailer keys create --name "Production"
# Delete an API key
getmailer keys delete <key-id>Email Validation
# Validate a single email
getmailer validate email [email protected]
# Validate emails from a file
getmailer validate list ./emails.txt
# Export results to CSV
getmailer validate list ./emails.txt --output results.csv
# Export as JSON
getmailer validate list ./emails.txt --json --output results.jsonA/B Testing (Experiments)
# List experiments
getmailer experiments list
getmailer ab list # alias
# Create an experiment
getmailer experiments create
# Get experiment results
getmailer experiments get <experiment-id>
# End an experiment
getmailer experiments end <experiment-id>
getmailer experiments end <experiment-id> --winner <variant-id>System Monitoring
# Check system health
getmailer monitor health
getmailer status health # alias
# View metrics
getmailer monitor metrics
# Live dashboard (updates every 10s)
getmailer monitor dashboard --watchInbox Placement Testing
# Manage seed lists
getmailer inbox-test seeds list
getmailer inbox-test seeds create
# Run inbox placement test
getmailer inbox-test run
# View test results
getmailer inbox-test list
getmailer inbox-test results <test-id>
# Watch for results (polls until complete)
getmailer inbox-test results <test-id> --watchAuto-Remediation
# View configured playbooks
getmailer remediation playbooks
# View remediation history
getmailer remediation history
getmailer remediation history --limit 50
# Test a trigger (dry run)
getmailer remediation test BOUNCE_RATE_HIGHConfiguration
# Set configuration values
getmailer config set apiKey gm_your_key
getmailer config set apiUrl https://custom.getmailer.app
# Get configuration
getmailer config get apiKey
# List all configuration
getmailer config list
# Show config file path
getmailer config path
# Clear all configuration
getmailer config clearOutput Formats
Most commands support --json flag for JSON output:
getmailer emails list --json
getmailer templates list --jsonEnvironment Variables
GETMAILER_API_KEY- API key (alternative togetmailer login)GETMAILER_API_URL- Custom API URL (default: https://getmailer.app)
Examples
Send a Welcome Email with Template
# Create template
getmailer templates create \
--name "Welcome" \
--subject "Welcome to {{company}}, {{name}}!" \
--html "<h1>Hello {{name}}</h1><p>Welcome to {{company}}!</p>"
# Send using template
getmailer send \
-f [email protected] \
-t [email protected] \
-s "Welcome" \
--template <template-id> \
--vars '{"name": "John", "company": "Acme Inc"}'Send Newsletter to Multiple Recipients
# Create recipients.json
echo '[
{"to": "[email protected]", "variables": {"name": "Alice"}},
{"to": "[email protected]", "variables": {"name": "Bob"}}
]' > recipients.json
# Send batch
getmailer batch create \
--name "March Newsletter" \
--from [email protected] \
--template <template-id> \
--recipients ./recipients.jsonSupport
- Documentation: getmailer.app/docs
- Issues: GitHub Issues
