Using /api/transactional-mails/send
endpoint you can send a transactional mail.
$ MAILCOACH_TOKEN="your API token"
$ curl -X POST https://[[your-domain]].mailcoach.app/api/transactional-mails/send \
-H "Authorization: Bearer $MAILCOACH_TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"mail_name":"name-of-the-mail", "subject": "Subject of your mail", ...}'
These are the parameters you should give to this call:
-
mail_name
: the name of the transactional mail as specified on the mails screen. This is required if you don't sendhtml
-
html
: if you want to use a transactional mail (as defined on the mail screen), you can provide HTML that will be used as the body of your email. -
subject
: the subject used for the transactional mail -
from
: the from address that will be used -
to
: the to address to use. You can specify multiple addresses comma-delimited. -
cc
: the cc address to use. You can specify multiple addresses comma-delimited. -
bcc
: the bcc address to use. You can specify multiple addresses comma-delimited. -
store
: defaults totrue
, when set to false the transactional mail will not be added to the transactional mail log -
mailer
: the name of the mailer to use to send the mail. If not set, we'll use the default of your account -
replacements
: a key-value array that will be used to fill all replacers in your mail. These will only be used if you also specifiedname
.