Newsletter delivery (add-on)
The suppression list, the deliverability checks, and the email provider webhooks.
What keeps mail arriving: the addresses the store must never mail, the checks on its sending setup, and the webhook each email provider reports back through. See Health and Delivery reports and providers.
List suppressed addresses
/api/v1/kahunacart/newsletters/suppressions
The addresses this store will never mail again, whatever any list or import says about them, with why each one is here and when. The audience of every campaign is checked against this table before a single row is written. A row whose address reads as erased belonged to somebody who asked to be forgotten: the hash stays so the address is still never mailed.
Parameters
| Name | Type | Description |
|---|---|---|
| reason optional | string |
One of:
hard_bounce, complaint, manual, invalid |
| sort optional | string |
Sort by this column instead of newest first
One of:
email, reason, added |
| dir optional | string |
Which way sort runs. Without it, dates and counts run highest first and words A to Z
One of:
asc, desc |
| q optional | string | Words to search for in the address, note and reporting provider; every word has to be there, wherever it sits. Applied before the sort and the page, and total counts what it found while counts stay for the whole table |
| page optional | integer | At least 1. |
| per_page optional | integer | At least 1, at most 200. |
Suppress an address
/api/v1/kahunacart/newsletters/suppressions
Tell the store never to mail an address again, for somebody who asked directly rather than through a link. The subscriber's own status is written at the same time, so the screens and the sender cannot disagree. The reason has to be "manual" or "invalid" — a bounce and a complaint are facts a mail provider reports and the store records them itself, and typing one by hand would be writing evidence that never arrived.
Parameters
| Name | Type | Description |
|---|---|---|
| email required | string | |
| reason optional | string |
Defaults to manual
One of:
manual, invalid |
| note optional | string or null | Why, for whoever reads this in a year |
Start mailing an address again
/api/v1/kahunacart/newsletters/suppressions/{hash}
Remove one suppression, addressed by the SHA-256 of the address — which is how the row is keyed, because that is the half that survives an erasure. Only do this when you know why the address landed there: mailing one that complained is how a store loses its sending reputation. The subscriber's own status is left alone on purpose, so removing a suppression does not quietly resubscribe anybody.
Parameters
| Name | Type | Description |
|---|---|---|
| hash required | string | SHA-256 of the normalized address |
Why this store's mail is or is not landing
/api/v1/kahunacart/newsletters/deliverability
Nine checks over the store's sending setup, each with a status, a sentence saying what is true and a sentence saying what to do about it. The domain group is SPF, DKIM, DMARC and the from address, read live from DNS; the transport group is whether a campaign carries a plain-text part, whether the one-click unsubscribe headers survive the transport in use, whether the sending throttle is sane and whether the provider's webhook is configured and has been heard from; the list group is the bounce and complaint rates over the last thirty days against the thresholds Gmail publishes. Run this when a merchant says their mail lands in spam, when a campaign's delivered count looks wrong, or before a store sends its first real campaign. Answers are cached for ten minutes; anything reported as still checking means a lookup had not come back, and asking again a moment later returns it.
Run the deliverability checks again, ignoring the cache
/api/v1/kahunacart/newsletters/deliverability/recheck
Throw away the cached DNS answers and look everything up again. Use it after a merchant has changed a DNS record — an SPF include added, a DKIM selector published, a DMARC policy moved off none — because the ordinary read would otherwise answer with what was true up to ten minutes ago. It makes real DNS queries and, on a store whose transport can be asked, one API call to that provider, so it is not something to run in a loop.
Generate a provider webhook secret
/api/v1/kahunacart/newsletters/providers/{name}/secret
Mints a fresh random path secret for one of the seven email providers (smtp2go, ses, postmark, mailgun, sendgrid, resend or mailersend), writes it into the plugin's configuration, and answers the whole webhook URL to paste into that provider's dashboard. The secret is what tells a genuine event from a stranger who guessed the address, and on SMTP2GO, which signs nothing, it is the only thing that does. Generating a new one silently stops the old URL working, so a provider already pointed at the previous secret has to be updated or its events are dropped.
Parameters
| Name | Type | Description |
|---|---|---|
| name required | string |
Which provider the secret is for
One of:
smtp2go, ses, postmark, mailgun, sendgrid, resend, mailersend |
Create the webhook in the provider
/api/v1/kahunacart/newsletters/providers/{name}/setup
Registers this store's webhook URL with the provider through its own API, for the delivered, bounce, spam complaint, open and click events, using the API key already in that provider's transport settings, so a merchant does not have to find the right screen in somebody else's dashboard. Whether a provider can is its own answer: SMTP2GO, SendGrid, Mailgun, Resend, MailerSend and Amazon SES (ses) can with the key on file, and Postmark can once its server token is in. One that cannot answers with a refusal naming the manual steps instead. Generate a secret first, because there is no URL to register without one. When it works, and the provider is the one the site sends through, one test message goes out through the site's own transport (to the provider's own test address where it has one, otherwise to the store's From address, never to a subscriber), and the answer's test says where it went; the Settings card then shows whether its event came back.
Parameters
| Name | Type | Description |
|---|---|---|
| name required | string |
Which provider to create the webhook in
One of:
smtp2go, ses, postmark, mailgun, sendgrid, resend, mailersend |
Send a webhook test message
/api/v1/kahunacart/newsletters/providers/{name}/test
Sends one small test message through the site's own transport to check that the provider's webhook reports back, the same as the Send a test button on the provider's Settings card. It goes to the provider's own test address where its plugin names one (which nobody receives), otherwise to the store's From address, never to a subscriber. Only the provider the site sends through can be tested, there must be a webhook secret, and one test a minute per provider. The answer's test says where it went and starts as waiting; ask get_provider_webhook_test for what came back.
Parameters
| Name | Type | Description |
|---|---|---|
| name required | string |
Which provider to test
One of:
smtp2go, ses, postmark, mailgun, sendgrid, resend, mailersend |
Where a webhook test stands
/api/v1/kahunacart/newsletters/providers/{name}/test
Where the provider's last webhook test stands: none (never tested), waiting, received (with the seconds it took), refused (the event arrived and its signature did not check out, nearly always a missing or wrong signing secret), or nothing (two minutes passed with no event, with url_changed when a new secret was made after Set up).
Parameters
| Name | Type | Description |
|---|---|---|
| name required | string |
Which provider to ask about
One of:
smtp2go, ses, postmark, mailgun, sendgrid, resend, mailersend |