Skip to content
LITE
Email

Transactional email

8 min readUpdated September 2026Applies to: Lite & Pro

Everything here lives under Settings → Emails. One master switch at the top, Send transactional email notifications, turns every outgoing message off at once — the setting to reach for on a staging copy of a live site, where the last thing you want is a test approval mailing a real affiliate.

Who it’s from#

From name and From email. Leave the name blank and the site’s own name is used; leave the address blank, or put something that isn’t a valid address, and WordPress’s own default sender applies instead — the plugin never invents a fallback address of its own. Setting both is worth the two minutes it takes: an affiliate opens something from your programme’s name far more readily than something from whatever string your host puts on outgoing mail by default.

The ten notifications#

EventGroupGoes to
New applicationApplicationyou
Welcome, when an application is approved automaticallyApplicationthe affiliate
Application received, pending reviewApplicationthe affiliate
ApprovedAccountthe affiliate
RejectedAccountthe affiliate
Domain request approvedDirect linksthe affiliate
Domain request rejectedDirect linksthe affiliate
New commissionCommissionthe earning affiliate
Payout paidPayouteach affiliate in the batch
Performance summaryReportsthe affiliate, on your schedule

All ten ship switched on. Each has its own toggle in the Individual emails table, so you can, say, keep the payout notice and drop the per-commission one — the pair most programmes end up adjusting once affiliates start asking why their inbox fills up on a busy day. The table groups events the same way the list above does, and marks any row you’ve edited with a small “Edited” label so you can tell customised copy apart from the shipped default at a glance.

Two of these are worth knowing the mechanics of. New application actually fires up to two messages: the admin notice always goes to get_option('admin_email'), and the affiliate gets either the welcome (if the programme auto-approves) or the “application received” acknowledgement (if it needs your review) — never both, decided by which status the registration resolved to. And domain request rejected carries a {{reason}} tag that’s only populated when you actually gave one; leave the reason blank when rejecting and the template’s reason line renders empty rather than printing a placeholder.

Rewriting one#

  1. Find the notification in the Individual emails table and press Edit content.
  2. Rewrite the subject and body. Three tags work everywhere — {{site_name}}, {{site_url}} and {{affiliate_dashboard_url}} — and each event lists exactly the extra tags it can fill, not a guess: {{affiliate_name}} and {{affiliate_email}} on most, {{amount}} and {{currency}} on the commission, payout and summary messages, {{payout_method}} on the payout one, {{domain}} on both domain decisions and {{reason}} on the rejection, {{period}} and {{referrals}} on the summary, and {{affiliate_status}} with {{admin_affiliates_url}} on the one that comes to you. Click a tag in the list and it drops in at wherever the cursor last was, in the subject or the body.
  3. Basic HTML is allowed in the body; the branded header and footer wrap around it automatically, so a rewritten body is a fragment, not a full document.
  4. Press Preview. It renders through exactly the shell the mailer uses — not a second copy of the markup that could quietly drift from the real thing — and it renders whatever you’ve typed even if you haven’t saved yet, inside a sandboxed iframe so a template somebody pasted in can’t run anything against the admin screen around it.
  5. Press Send me a test to see it land in a real inbox, then Done, then save the settings page — nothing here is stored until that final save.

Clearing a field is a valid way to undo a rewrite: an empty subject or body falls back to the plugin’s own default, and there’s a Reset to default button that does the same thing in one press. An unedited notification isn’t frozen at whatever it said on the day you installed the plugin — it keeps whatever the shipped copy currently says, which improves as the plugin does.

The test send, specifically#

It goes to the email address on your own WordPress account and nowhere else, with [Test] in front of the subject line. There’s deliberately no field for a different recipient: a route that accepted one would be a way to send mail from somebody else’s site to an address of your choosing, which is a spam relay with a login screen in front of it rather than a preview tool. If a colleague needs to see it, forward the test yourself.

How the emails look#

One header treatment applies to every notification, configured once under How the emails look:

  • Logo, shown in the header in place of the site name. Around thirty-six pixels tall renders well across clients; noticeably taller and some clients crop it.
  • Header colour. Pick something dark — the header text renders white regardless, so a pale brand colour makes it unreadable, which is exactly the mistake this field’s hint exists to head off. Left blank, it falls back to a dark teal that’s part of the product’s own accent.
  • Header text, used only when there’s no logo set.
  • Footer text, the line at the bottom of every message — your programme’s name, or a reply-to instruction. Left blank, it falls back to your site’s name, the same as the header.

Language#

Every notification is composed in the recipient’s own language rather than the site’s default or whatever locale the admin who triggered it happens to be using — switch_to_user_locale() runs around the whole send, subject, body and the branded shell’s own footer text included, and is guaranteed to be restored afterward even if sending throws partway through. An affiliate who registered in Spanish gets a Spanish payout notice regardless of what language the person who clicked “mark as paid” was reading the admin screen in.

The recap email#

A different mechanism from the nine event-triggered notifications above: Performance summary, under Settings → Emails, takes three values — Do not send (the default), weekly, on Mondays, or monthly, on the 1st. Affiliates who earned nothing and referred nobody in the period aren’t mailed at all; a recurring “you earned $0” is how a programme teaches its own affiliates to filter its mail.

The schedule is driven by a daily cron tick rather than a weekly or monthly one — WordPress cron only fires on site traffic, and a monthly event on a quiet site can drift by days or be skipped outright, where a missed monthly summary is a missed month entirely. Each day the tick asks a narrower question instead: did a period just close? A week closes on Monday, reporting the seven days that ended the Sunday before; a month closes on the 1st, reporting the month just finished. Whichever period closed is recorded as sent before the mail goes out, not after, so a run that dies halfway through a large affiliate list doesn’t mail the whole programme a second copy on the next day’s tick.

Each affiliate’s own referral count and earnings for the closed period are counted fresh from the referral table for that window — this is the same affiliate_summary notification event as the table above, with its own toggle, its own editable template, and its own preview.

Under the hood#

Email HTML isn’t web HTML: Outlook renders through Word, so the layout here is nested tables rather than a max-width div; a phone client that sees no viewport meta shrinks the whole message to fit rather than reflowing the text. The shell also writes a hidden preheader — the line an inbox shows next to the subject in a list view — pulled from the first sentence of the message rather than left to whatever a client finds first in the markup, which without this is usually a logo’s alt text or a stray “view in browser” link nobody wrote on purpose. And a link that sits alone in its own paragraph, <p><a href="…">text</a></p> with nothing else around it, is rendered as a button; a link with words around it stays a plain link. That’s a deliberately narrow rule rather than a rich-text toggle, because a stored template has to survive wp_kses_post on the way in, which strips the inline styles a button needs — so the shell adds them back afterward, at send time, using whatever accent colour you’ve configured rather than a colour hardcoded into the template.

A theme can replace this shell wholesale by supplying squad-affiliate/email-shell.php, and the final assembled document still passes through a filter (squad_affiliate_email_html) before wp_mail() sees it either way — the seams here are for an email-customiser plugin or a theme override, not for editing the individual templates, which is what the settings screen is for.