This is an n8n template that Automate welcome emails with discount codes via Mailchimp and Gmail
Who's it for
Perfect for e-commerce businesses, SaaS companies, course creators, and service providers who want to automatically nurture new subscribers with personalized welcome emails and discount codes. If you're looking to boost conversions from your website signup forms and create a professional onboarding experience, this workflow is your solution.
How it works
This workflow creates a seamless subscriber onboarding process:
- Webhook receives signup data from your website form (name, email, timestamp, source)
- Mailchimp integration automatically adds the subscriber to your email list with their name
- Gmail sends personalized welcome email with a discount code and branded content
- Error handling ensures the welcome email sends even if Mailchimp fails
The workflow is triggered instantly when someone submits your website signup form, creating a professional first impression that can significantly improve customer engagement and conversion rates.
How to set up
Requirements
- Mailchimp account with an active audience/list
- Gmail account with OAuth2 access
- Website or landing page with a signup form
- Basic HTML/CSS knowledge for email customization (optional)
Step-by-step setup
1. Configure Mailchimp Integration
- Create or identify your Mailchimp audience
- Replace YOUR_MAILCHIMP_LIST_ID with your actual list ID
- Add your Mailchimp API credentials in n8n
- Set up any custom merge fields you need (FNAME is included by default)
2. Set Up Gmail Credentials
- Add your Gmail OAuth2 credentials in n8n
- Ensure the sending email account has appropriate permissions
- Test email delivery to avoid spam folder issues
3. Customize the Welcome Email
- Replace [Your Business Name] with your actual business name
- Update the discount code (WELCOME15) with your preferred offer
- Modify the shop URL (https://your-website.com/shop) to your store.
- Update social media links with your actual profiles
- Customize colors, fonts, and branding to match your business.
4. Deploy Your Webhook
- Copy the webhook URL from the n8n workflow
- Add this URL to your website signup form as the POST endpoint
- Ensure your form sends JSON data with name and email fields
5. Test the Complete Flow
- Submit a test signup through your website form
- Verify the contact appears in Mailchimp
- Check that the welcome email arrives with proper personalization
How to customize the workflow
Advanced Email Personalization
- Dynamic content blocks: Add conditional sections based on signup source or user preferences
- Custom merge fields: Capture additional data like company name, phone number, or interests in Mailchimp
- Segmented messaging: Create different email templates for different subscriber types
- Multi-language support: Detect user language from form data and send localized emails
Webhook Integration Examples
Google Forms Integration:
- Use Google Apps Script to POST form responses to your n8n webhook
- Map form fields to the expected JSON structure (name, email, source)
Typeform Integration:
- Configure Typeform webhooks in Connect panel
- Set payload to include question responses in the required format
Custom HTML Forms:
// Example form submission code
fetch('YOUR_N8N_WEBHOOK_URL', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: document.getElementById('name').value,
email: document.getElementById('email').value,
source: 'website'
})
});
WordPress Contact Form 7:
- Use CF7 hooks to send form data to your webhook endpoint
- Install REST API plugins for seamless integration
Workflow Logic Enhancements
- Data validation: Add If nodes to check email format and required fields before processing
- Duplicate prevention: Query Mailchimp first to avoid adding existing subscribers
- Source-based routing: Send different welcome emails based on signup source (blog, product page, etc.)
- Lead scoring: Assign scores based on signup source and send to appropriate lists
- Follow-up sequences: Add Wait nodes to create multi-step email campaigns
Advanced Integrations
- CRM sync: Connect to Salesforce, HubSpot, or Pipedrive to create leads automatically
- Analytics tracking: Log conversions to Google Sheets or send events to Google Analytics
- Slack notifications: Alert your team about high-value signups or VIP customers
- SMS follow-up: Add Twilio integration for multi-channel welcome sequences
Troubleshooting
Common Issues and Solutions
Emails going to spam folder:
- Configure SPF and DKIM records for your sending domain
- Use Gmail's "Send as" feature to authenticate your sending address
- Start with low volume and gradually increase to build sender reputation
- Include unsubscribe links and proper email headers
Mailchimp API errors:
- Check your API key permissions and rate limits
- Verify the list ID is correct (found in Audience settings)
- Ensure required fields are properly mapped
- Review Mailchimp's compliance requirements for your region
Webhook not triggering:
- Test the webhook URL directly using tools like Postman
- Check that your form sends POST requests with proper Content-Type headers
- Verify JSON payload structure matches expected format
- Review n8n execution logs for error details
Personalization not working:
- Confirm form field names match the n8n node references
- Check that data is properly passed between workflow nodes
- Test with sample data to isolate mapping issues
- Use n8n's data inspection tools to debug payload structure
Performance Optimization
High-volume handling:
- Consider using Mailchimp's batch operations for multiple signups
- Implement queue systems for processing during traffic spikes
- Monitor workflow execution times and optimize slow nodes
- Set up error notifications to catch issues quickly
Delivery improvements:
- Use dedicated email services like SendGrid or Mailgun for better deliverability
- Implement email warmup procedures for new sending domains
- A/B test subject lines and send times for better engagement
- Monitor bounce rates and remove invalid emails promptly.