WorkflowMail adds two Flow triggers: unsubscribes and failed email delivery

Until now, WorkflowMail was the last step of a Shopify Flow workflow: Flow decided that an email should go out, and WorkflowMail sent it. Two new triggers change that. Flow can now start a workflow from what happens to an email after it leaves: a recipient unsubscribes, or a message cannot be delivered.
Both events used to be invisible inside Shopify. An unsubscribe lived in the app and slowly drifted away from the customer's Shopify marketing consent. A failed delivery sat in a log until someone noticed that a customer never received their download link or account notice. With these triggers, each event can update a record, tag a customer, or notify a person.
WorkflowMail now has two Flow triggers: Recipient unsubscribed and Unsuccessful email delivery. Here is what each one does, and two workflows you can build from them today.
The two triggers at a glance
Both triggers appear under WorkflowMail – Emails for Flow when you add the first step to a new workflow. They start a workflow; they do not send anything on their own.

| Trigger | Starts a workflow when… | Typical use |
|---|---|---|
| Recipient unsubscribed | An email recipient submits the unsubscribe form using the link in the footer of your email. | Mirror the opt-out into Shopify marketing consent, remove marketing tags, keep a record for support |
| Unsuccessful email delivery | WorkflowMail is unable to deliver your email. Delayed delivery does not fire the trigger. | Alert staff, tag the customer or order, route the case to whoever can fix the address |
The trigger descriptions above are the ones Shopify shows in the editor. Which fields each trigger exposes is listed in Flow's variable picker after you add the step; both examples below use those variables rather than hard-coded values.
Why "after the email" is worth automating
Most Flow email workflows end at the send step. That is fine for the happy path, but two things quietly go wrong afterwards.
Consent drifts. A customer unsubscribes from one of your WorkflowMail emails, and WorkflowMail stops mailing that address. Shopify, however, still believes the customer agreed to marketing. The next campaign built on Shopify's consent state reaches someone who already said no. That is a compliance problem and a deliverability problem at the same time.
Failures stay silent. A transactional email fails because of a typo in the address, a domain that no longer exists, or a mailbox that refuses your mail. The workflow reports success, the log has an error, and the customer is left waiting for a file or an account confirmation. Nobody finds out until the customer writes in — if they write in at all.
Both triggers turn those silent events into a workflow run. What you do with the run is up to you.
Workflow 1: mirror WorkflowMail unsubscribes into Shopify
Trigger: Recipient unsubscribed
The goal is simple: when someone opts out through a WorkflowMail email, the customer record in Shopify should say so. That keeps marketing consent in one place and stops other channels from mailing the same person.

This is the shape of the ready-made template, and it is worth understanding each step:
- Recipient unsubscribed starts the run and provides the address that opted out.
- Get customer data runs an advanced customer query to find the matching customer record. A recipient address is not a customer ID, so the lookup is necessary.
- Log output writes the matched customers to the run log. When something looks wrong later, this is the first place to check.
- For each loop iterates over the query result. One email address can belong to more than one customer record, and each of them needs the same treatment.
- Send Admin API request performs the
customerEmailMarketingConsentUpdatemutation withmarketingStateset toUNSUBSCRIBED. - Send Admin API request (1) performs the
customerUpdatemutation to adjust the customer record itself, so the record and the consent agree — for example, removing a tag that a marketing segment targets.
You can install the template from the WorkflowMail template gallery and adapt it, or rebuild the same steps by hand.
Guardrails for the unsubscribe workflow
- Expect zero matches. The address that unsubscribed may not belong to a customer: it could be a forwarding address, a shared inbox, or a customer whose record was deleted. The workflow should finish quietly, not fail. The template's loop handles this naturally.
- Expect more than one match. Duplicate customer records are common in stores that import from other platforms. The loop exists so that every matching record is updated, not just the first one.
- Do not invent consent. Set
marketingStatetoUNSUBSCRIBEDand never writeSUBSCRIBEDorCONFIRMED_OPT_INfrom this workflow; the only correct direction is out.NOT_SUBSCRIBEDis not an option here: Shopify rejects it as input for this mutation, because it is the internal state for customers who never subscribed. - Keep the tag change and the consent change together. If your campaigns target a tag such as
newsletter, removing it in the same run prevents a segment from going out between the unsubscribe and the consent update. - Log before you update. The log step costs nothing and makes the run explainable to a colleague or a privacy request later.
A useful extra step is a condition before the Admin API calls that checks the customer's current emailMarketingConsent.marketingState. If it is already UNSUBSCRIBED, skip the mutation. That keeps the run log readable and avoids pointless API calls when the same address unsubscribes twice.
Workflow 2: tell staff when a delivery fails
Trigger: Unsuccessful email delivery
A failed transactional email is a support ticket that has not been opened yet. Someone paid for a file, requested a quote, or is waiting for account details, and the message never arrived. The workflow's job is to put that fact in front of a person who can act on it.

Two steps, no branching. The internal email includes the subject of the failed message through the trigger's {{ subject }} variable, so the recipient knows which email to investigate before opening anything.
Use Flow's built-in Send internal email action rather than a WorkflowMail action for the alert. That action is sent by Shopify, so the alert still arrives if the problem is with your WorkflowMail sender, domain, or mail provider. An alert that depends on the same broken path is not much of an alert.
What to put in the alert
The subject above is a good start. In the body, add the details that let someone fix the problem without opening three other tabs:
- the recipient address that failed,
- the subject of the failed email,
- the delivery error returned by WorkflowMail,
- the related order or customer, if the workflow has it, with a link to the admin page,
- the date and time of the attempt.
Flow's variable picker lists exactly which of these the trigger returns. Add the ones that exist for your case, and guard each with a condition if the field can be empty — a missing order reference should not stop the alert.
Guardrails for the failure workflow
- Do not auto-retry the same address. A hard failure usually means the address is wrong or the domain is refusing mail. Sending again damages your sender reputation and still fails. Fix the address, then send again from the workflow that owns the message.
- Do not email the customer. If the address cannot receive mail, an apology will not arrive either. Notify staff and use a different channel if the case is urgent.
- Watch the noise. If a provider or domain has a bad hour, one alert per failed email can flood the inbox. Send to a shared support address rather than one person, and consider narrowing the workflow to the emails that matter most — account details, downloads, invoices — rather than every message you send.
- Keep the alert mailbox monitored. A workflow that notifies an unread inbox just moves the silence somewhere else.
How to test both workflows
Triggers that depend on real delivery behaviour are easy to get wrong in a way that only shows up in production. Test each path once, deliberately.
- Unsubscribe: send yourself a WorkflowMail email that carries the unsubscribe footer, click the link, and submit the form. Check that the workflow ran, that the log lists the expected customer, and that the customer's email marketing consent now shows as unsubscribed in Shopify admin.
- Unsubscribe with no customer: repeat with an address that is not on any customer record. The run should complete, log an empty result, and not raise an error.
- Failed delivery: send a WorkflowMail email to an address that will be rejected outright, such as a non-existent domain, and confirm that the alert arrives with the right subject. A full or temporarily unavailable mailbox is not the right test, because delayed delivery does not fire this trigger.
- Turn it on. Both workflows are harmless in draft, but neither does anything until it is turned on. Flow only starts runs for active workflows.
Things to keep in mind
- The unsubscribe trigger is about WorkflowMail's form, not Shopify's consent field. A change made in Shopify admin, or by another app, does not start this workflow. That is exactly why the workflow writes the consent back to Shopify.
- One unsubscribe can mean several customers. Match by address, then loop. Do not assume a single record.
- "Unsuccessful" is not "delayed". The trigger fires on a failure, not on a message that is still in transit. If you need to chase slow deliveries, that is a different job.
- Neither workflow uses a WorkflowMail email action. They react and update records; the only email in the examples is Shopify's internal alert. Your WorkflowMail email quota stays for actual customer email.
- Consent changes deserve an audit trail. Keep the log step. When someone asks why a customer stopped receiving marketing, the run log is the answer.
Frequently asked questions
What are the two new WorkflowMail Flow triggers?
Recipient unsubscribed starts a workflow when a recipient submits the unsubscribe form linked in your email footer. Unsuccessful email delivery starts a workflow when WorkflowMail cannot deliver an email. Both appear in Flow's trigger picker under the WorkflowMail app.
Does the unsubscribe trigger fire when a customer unsubscribes in Shopify?
No. It is tied to WorkflowMail's unsubscribe form. If you want Shopify's marketing consent to follow what happens in WorkflowMail, build the sync workflow above: look up the customer by address, then set marketingState to UNSUBSCRIBED with the customerEmailMarketingConsentUpdate mutation.
Does "Unsuccessful email delivery" include soft bounces and delays?
No. The trigger description is explicit that it does not notify about delayed delivery. It fires when WorkflowMail is unable to deliver the email, which is the case you need to act on: the message is not going to arrive on its own.
Can I notify the customer when their email fails?
Not usefully — the address is the part that failed. Notify your team instead, fix the address, and resend the message from the workflow that owns it. For urgent cases such as downloads or account access, a phone number or another contact route is more reliable than another email.
Do these workflows use my WorkflowMail email actions?
No. Triggers do not send anything, and neither example workflow adds a WorkflowMail email action: one updates customer records through the Admin API, the other sends a Shopify internal email. Your WorkflowMail email actions stay available for customer email. The free plan includes 500 lifetime Flow actions to try.
Where do I find the templates?
Open the WorkflowMail templates in the Flow editor. The unsubscribe workflow is listed as Unsubscribe customers who unsubscribe from WorkflowMail. The failed-delivery workflow is two steps and quick to build by hand.
Close the loop after the send
Most email automation stops when the message leaves. These two triggers let a workflow pick up the two outcomes that actually need a human or a record update: someone opted out, or someone never got the mail. Build the unsubscribe sync first, because it protects every campaign that follows. Add the failure alert to the handful of emails where a missed message really costs something.
WorkflowMail includes both triggers alongside the Send transactional email action. If you are new to Flow, start with the practical guide to Shopify Flow, then browse the template library for a workflow to adapt.
Free plan available · 500 free lifetime Flow actions to try · Built for Shopify
Happy automating! 🚀