Generate AI newsletters from form inputs and send via SendGrid
Streamline your email marketing process with this AI-powered "Human-in-the-Loop" workflow. It allows you to generate high-quality, targeted newsletters from a simple form input, review them via email, and automatically distribute them to your subscribers upon approval.
## Who is this for?
Digital marketers, content creators, community managers, and small business owners who want to maintain consistent communication with their audience but need to reduce the time spent on drafting and formatting emails.
## What does this workflow do?
- Input Collection: Starts with a user-friendly n8n Form where you input the newsletter topic, target audience, and sender details.
- Data Logging: Automatically saves the form responses to a Google Sheet for your records.
- AI Generation: Uses OpenAI (GPT-4o) to draft a catchy subject line and valuable body content formatted in Markdown based on your inputs.
- Approval Process: Sends a "Review Request" email to your inbox (via Gmail). This email contains a preview of the newsletter and a special link to approve it.
- Execution Wait: The workflow pauses and waits for you to click the approval link.
- Distribution: Once approved, it converts the Markdown to HTML and sends the final newsletter to your subscriber list using SendGrid.
## Requirements
- OpenAI API Key: To utilize GPT-4o for content generation.
- Google Cloud Account: Required for the Google Sheets (logging) and Gmail (approval notifications) nodes.
- SendGrid Account: Required for sending the final newsletter to your subscribers.
- n8n version: Ensure you are using a version that supports the LangChain nodes.
## How to set up
- Configure Credentials: Set up your credentials for OpenAI, Google (Sheets & Gmail), and SendGrid within n8n.
- Subscriber List: Open the Workflow Configuration node (Set node). Replace the placeholder with your comma-separated list of subscriber emails.
- Google Sheets: Create a Google Sheet with columns for
topic, target, sender, and admin_email. Update the Store Form Responses node with your Document ID and Sheet Name.
- Sender Verification: In the SendGrid node, ensure the "From Email" matches a verified sender identity in your SendGrid account.
- Test: Click "Test Workflow," fill out the Form Trigger URL, and check your email for the approval draft. Click the link in the email to finish the process.
## How to customize
- Change the AI Model: You can swap the OpenAI model node for Anthropic (Claude) or a local LLM if preferred.
- Adjust the Prompt: Edit the system message in the Generate Newsletter Content agent node to change the tone or structure of the newsletter.
- Swap Email Providers: If you don't use SendGrid or Gmail, simply replace these nodes with the email service of your choice (e.g., Mailchimp, Outlook, AWS SES).