Send announcements through a different service
The site sends two kinds of email, and you may send them in different ways. A service built for one-at-a-time messages delivers a login link in seconds but may not welcome a newsletter. A mailbox with a daily sending limit is fine for a weekly announcement but is not something to hang logins on. This page is for you if you want each kind to use the service that suits it.
By default you do nothing: both kinds go out through the one provider named by EMAIL_PROVIDER.
Which messages are which
| Kind | Messages |
|---|---|
| Transactional | Member login links. Admin login links. Contact-form messages to the choir. Ticket emails (the confirmation and the resend). Plain receipts to donors. The thank-you to someone who gave online, and the notice to the choir about it. The notice to the choir that someone stopped or restarted a kind of mail. |
| Announcements | Announcements emailed to members, and every mailing to donors or ticket holders (appeals, "News or promotion", "About this concert"). The test copies you send of either. |
The rule of thumb: anything a person is waiting for, or that is part of an order or a gift, is transactional. Anything the choir writes and sends to a list is an announcement. The complete table is in Every email your site sends.
Repeat a setting with a prefix
Any of these email settings can be given again with TRANSACTIONAL_ or ANNOUNCEMENT_ in front:
EMAIL_PROVIDER,EMAIL_FROM,EMAIL_REPLY_TO,EMAIL_BOUNCE_ADDRESSAWS_REGION,AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEYSMTP_HOST,SMTP_PORT,SMTP_SECURE,SMTP_USER,SMTP_PASSRESEND_API_KEY,SENDGRID_API_KEYMAILGUN_API_KEY,MAILGUN_DOMAIN,MAILGUN_REGIONPOSTMARK_SERVER_TOKEN
So ANNOUNCEMENT_SMTP_HOST is the SMTP host for announcements only. The rules:
- A prefixed setting wins for its kind. When the prefixed one is missing or empty, the site uses the plain name. The plain settings are the default for both kinds.
ANNOUNCEMENT_only looks at the plain names, never atTRANSACTIONAL_ones. ATRANSACTIONAL_setting changes login links and the other transactional mail, and nothing else. It does not pass down to announcements.- The pace settings have no prefix.
EMAIL_PER_SECOND,EMAIL_BATCH_SIZEandCONTACT_FORM_TOare single settings for the whole site. - Each kind may use a different provider, and a provider that cannot run on your platform (SMTP on Cloudflare) cannot be used for either.
A worked example
Login links through Amazon SES, announcements through the choir's own mailbox, from a different address:
# Everything not repeated below, including logins and contact messages
EMAIL_PROVIDER=ses
EMAIL_FROM="Harmony Community Choir <noreply@example.org>"
AWS_REGION=ca-central-1
AWS_ACCESS_KEY_ID=AKIAEXAMPLEEXAMPLE
AWS_SECRET_ACCESS_KEY=replace-with-the-secret
# Announcements and mailings
ANNOUNCEMENT_EMAIL_PROVIDER=smtp
ANNOUNCEMENT_EMAIL_FROM="Harmony Community Choir <news@example.org>"
ANNOUNCEMENT_SMTP_HOST=smtp.example.org
ANNOUNCEMENT_SMTP_USER=news@example.org
ANNOUNCEMENT_SMTP_PASS=replace-with-the-password
ANNOUNCEMENT_SMTP_PORT is not given, so it is 587, the default; ANNOUNCEMENT_EMAIL_REPLY_TO is not given, so replies go to EMAIL_REPLY_TO if you set it. For a setup that needs no repeating of a provider, you can change only the sender: giving ANNOUNCEMENT_EMAIL_FROM alone sends announcements through the same provider from a different address.
The other way round: the default is a mailbox, and only the transactional mail goes through a sending service:
EMAIL_PROVIDER=smtp
EMAIL_FROM="Harmony Community Choir <news@example.org>"
SMTP_HOST=smtp.example.org
SMTP_USER=news@example.org
SMTP_PASS=replace-with-the-password
TRANSACTIONAL_EMAIL_PROVIDER=resend
TRANSACTIONAL_EMAIL_FROM="Harmony Community Choir <noreply@example.org>"
TRANSACTIONAL_RESEND_API_KEY=re_replace_with_your_key
Here announcements use the plain SMTP settings, because there are no ANNOUNCEMENT_ ones.
Switch announcement emailing off
ANNOUNCEMENT_EMAIL_PROVIDER=none
Logins and the rest of the transactional mail go on working. Announcements are still posted in the member portal; they just cannot be emailed. Be aware that mailings to donors and ticket holders are announcement mail too, so this also stops them: the admin panel then says "Email is not set up on the server, so nothing was sent".
Check it
Restart the server and run npm run config:check (see Check your configuration). When announcements are sent differently, the output has a second block called announcementEmail next to email:
"email": {
"provider": "ses",
"from": "Harmony Community Choir <noreply@example.org>",
"replyTo": "(none)",
"contactTo": "(the public contact email)"
},
"announcementEmail": {
"provider": "smtp",
"from": "Harmony Community Choir <news@example.org>",
"replyTo": "(none)"
},
When they are not, it reads "announcementEmail": "(the same as email)". The check also warns "Announcements have an email provider but no address to send from: set EMAIL_FROM or ANNOUNCEMENT_EMAIL_FROM" if you gave announcements a provider and no sender. Then send a test announcement; see Sender addresses, sending speed and testing.
On a site we host, this does not apply: a choir's own mail server is set up on the Email page of the admin panel instead, and carries announcements only. See Send announcements from your own address.