Suppress email unsubscribes and spam complaints everywhere

By General Input

When someone unsubscribes, reports spam, or gets blocked, we opt them out in your CRM, stop future campaigns, and log it for compliance.

Integrations

  • Mailjet
  • HubSpot
  • Google Sheets
  • Slack

Type

Deterministic Code

Categories

  • Operations
  • Marketing

When Mailjet reports that someone unsubscribed, marked an email as spam, or was blocked, suppress that person everywhere so we never email them again. Trigger this workflow from a webhook that receives Mailjet's Event API. Mailjet pushes open, click, bounce, blocked, spam, unsub and sent events to the same endpoint, so the first thing the workflow does is check the event type and only continue for unsub, spam and blocked. Any other event type should end the run quietly without raising an error.

Mailjet may post a single event object or, when event grouping is enabled, an array of events in one request. Handle both shapes and process each qualifying event independently. From each event take the recipient email address, the event type, the campaign identifier and the event timestamp. Blocked events also carry an error reason, so capture that when it is present.

Look up the person in HubSpot with Search Contacts, filtering on the email property for an exact match on the address from the event. If a contact comes back, use Update Contact with that contact's ID to set the opt-out and marketing status fields so the record is flagged as unsubscribed and no longer marketable. Use whichever opt-out and marketing contact status properties the portal has configured, and also record the suppression reason and date if properties exist for them.

Mark the same person as suppressed in Mailjet with Update a contact, setting IsExcludedFromCampaigns to true. A Mailjet contact can be addressed by email address directly, so the event payload is enough to make this call without a separate lookup.

Append a row to a Google Sheets suppression audit log with Append Values. Each row should capture the email address, the event type, the campaign and the timestamp, plus whether a HubSpot contact was found and updated. This sheet is the durable record of who was suppressed and why.

Post a short Slack notice with Send a Message only for spam complaints. Spam complaints hurt sender reputation and deserve a human look, while routine unsubscribes and blocked addresses do not need to interrupt anyone. The message should name the email address, the campaign and the time of the complaint.

If no HubSpot contact matches the address, still write the audit row and still exclude the contact in Mailjet, then finish successfully. Transactional recipients often have no CRM record, so a missing contact is a normal outcome rather than a failure. Note the missing match in the audit row so the gap stays visible.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageWin back LiveChat visitors whose chats went unansweredLet support send one-off Loops emails without an engineerTurn Mailjet email clicks into ranked HubSpot follow-upsStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsA searchable RFP answer library your bid team drafts fromLinkedIn Ads budget pacing dashboard for every client account