Unsubscribe Mautic contacts from automated unsubscribe emails
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
What this workflow does
This workflow has 11 nodes and runs on Gmail events. Along the way it connects Gmail and Mautic.
How it runs
Trigger: On Gmail events.
- Edit Fields (Edit Fields (Set)): sets or maps fields
- Is automated unsubscribe? (If): checks a condition and branches into true / false
- Extract Email from 'From' Field (Code): runs custom JavaScript code
- Extract Unique Email Addresses (Code): runs custom JavaScript code
- Get Mautic Contact ID from Email Address (Mautic): get many
- If: checks a condition and branches into true / false
- Add to unsubscribed segment (Mautic): work with contact segment
- Remove newsletter segment (Mautic): remove (contact segment)
- Reply Unsubscribe Message (Gmail): reply
- Add to Do Not Contact List (Mautic): edit do not contact list
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Gmail Trigger).
Nodes used (6)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - If
n8n-nodes-base.if - Mautic
n8n-nodes-base.mautic - Gmail
n8n-nodes-base.gmail - Code
n8n-nodes-base.code - Edit Fields (Set)
n8n-nodes-base.set
From the author
Who is this for? This template is designed for businesses and organizations that use Mautic for email marketing and want to automate the process of removing contacts from specific segments when they receive an unsubscribe request via email. What problem is…