n8n AI Email Marketing manual

Configure a three-email sequence with consent, OpenAI, Google Sheets, and Resend in n8n.

Who it is for: It is for people who use n8n and already have an external system that records consent and can send data to a webhook. You need basic familiarity with n8n credentials, Google Sheets, OpenAI, and Resend.

Setup time: Initial setup: variable depending on accounts and sending domain

What it does

  • Receives a POST request at the new-subscriber webhook path and responds when the request is received.
  • Reads data from the request body when present, otherwise from the node input data.
  • Accepts a contact only when email is non-empty, consent is Boolean true or the string true, and unsubscribe_url is non-empty and starts with http.
  • Normalizes email, name, source, unsubscribe URL, brand details, and offer details before continuing.
  • Appends the accepted record to the Google Sheets tab named Iscritti with automatic mapping of input data.
  • After 1 day it generates and sends a welcome email; after a further 3 days it generates and sends an informational email; after a further 5 days it generates and sends an offer email.
  • Uses the OpenAI gpt-4o-mini model to request simple HTML and sends each message through an HTTP POST request to Resend's email API.
  • Adds the unsubscribe link received in the webhook to the body of every email.

What it does not do

  • It does not collect consent or verify whether consent is legally valid: it only receives a value from an external system.
  • It does not create or host an unsubscribe page and does not automatically manage suppression lists or unsubscribe requests.
  • It does not validate an email address format beyond checking that the field is non-empty, and it does not check whether brand or offer URLs are reachable.
  • It does not use SMTP, Gmail, or SendGrid, and it contains no nodes to replace Resend with another provider.
  • It does not provide reporting, tracking, segmentation, attachments, form collection, or offer publishing.
  • It is not a legal, tax, or marketing-compliance certification.

Requirements

  • n8n: An n8n Cloud or self-hosted instance where you can import and activate workflows.
  • Google account and Google Sheets: An account that can be authorized in n8n and a target spreadsheet containing a sheet named Iscritti.
  • OpenAI: An account with an OpenAI API credential that can be configured in n8n. The package states that usage-based cost applies; check the provider's terms and price list.
  • Resend: A Resend account, API key, and verified sending domain. The service may be paid; check the provider's price list.
  • System that sends the webhook: A form, application, or other system able to make a POST request to the webhook only when a contact has provided consent.
  • Contact data: Each execution needs email, consent, and unsubscribe_url; it also supports name, source, brand_name, brand_url, offer_name, and offer_url.

Step-by-step setup

  1. Extract the package and choose a variant. Extract the ZIP into a private folder. Use n8n-email-marketing-ai.json for Italian recipients. Use n8n-email-marketing-ai.en.json for English recipients. The English variant intentionally keeps Italian node labels and the Iscritti sheet name.
  2. Read the delivered guides. Read README.md for the Italian guide. The English resources are README.en.md, n8n-email-marketing-ai.en.md, ENGLISH-WORKFLOW.en.md, and n8n-email-marketing-ai.en.json. The n8n-email-marketing-ai.en.md file is a translation reference and does not replace either JSON.
  3. Import the workflow into n8n. In n8n, use Workflows and then Import from File, and select the JSON you chose. The imported workflow is named DigitalHub — AI Email Marketing con consenso and has 12 connected nodes. Do not activate it yet.
  4. Connect Google Sheets. Open the Salva in Google Sheets node and authorize your Google account. Replace the documentId value YOUR_SHEET_ID with your spreadsheet identifier. In the delivered file, the node performs an append, uses the Iscritti sheet, and automatically maps input data; check its configuration and your sheet columns before activation.
  5. Connect the OpenAI credential. In the OpenAI: Email Benvenuto, OpenAI: Email Informativa, and OpenAI: Email Offerta nodes, replace the YOUR_OPENAI_CREDENTIAL reference with an OpenAI credential available in your n8n instance. All three nodes use the chat resource and gpt-4o-mini model.
  6. Configure Resend sending. Open all three Invia Email via Resend nodes. In each one, replace YOUR_RESEND_API_KEY in the Authorization header and replace YOUR_BRAND_NAME and YOUR_FROM_EMAIL in the from field. The sender must be compatible with the domain verified in your Resend account.
  7. Prepare the system that calls the webhook. Copy the test or production webhook URL appropriate to your n8n instance. The Webhook: Nuovo Iscritto node accepts the POST method at the new-subscriber path. Configure your external system to send the payload only for contacts who have given consent.
  8. Send a complete test payload. Use an address you control and a working unsubscribe URL. Consent can be the Boolean value true or the string true. If email, valid consent, or a valid unsubscribe URL is missing, Valida Iscritto returns no items and the sequence stops without a send.
  9. Check recording and waits. After successful validation, check that the record was added to the Iscritti sheet. The workflow then enters Wait 1 giorno. The welcome email is generated and sent after 1 day, the second after a further 3 days, and the third after a further 5 days.
  10. Review content and activate cautiously. Before exposing the production webhook, review generated content, sender, subjects, unsubscribe link, and n8n executions with a controlled recipient. The delivered files state that the English variant received offline and structural checks only; test both variants with non-production data before activation.

Daily use

Send only consented contacts

Have the webhook called only by the process that collected consent, and retain the information required by your own process. The technical consent check does not replace your assessment of applicable obligations.

Always provide complete data

Send email, consent, and unsubscribe_url in every request. Also send name, brand_name, brand_url, offer_name, and offer_url when you want to avoid the defaults embedded in the code.

Monitor the Iscritti sheet

Check that every accepted contact is appended to the Google Sheet and that normalized data matches what your upstream system sent.

Follow executions that are waiting

Each valid contact enters three Wait nodes: 1 day, then a further 3 days, then a further 5 days. Check n8n executions when you review a sequence in progress.

Review generated copy

OpenAI receives instructions to produce simple HTML, but generated content needs human review before publication or use with a real list.

Keep unsubscription working

Because the workflow places the unsubscribe_url value into every email body without creating the page or handling the request, make sure the URL is relevant to the contact and continues to work.

Practical cases

Welcome after newsletter signup

A small online shop uses an external form that records consent and can send a webhook after a voluntary newsletter signup.

  1. The form records consent according to the shop's chosen process.
  2. The system sends email, consent true, an unsubscribe URL, and brand data to the webhook.
  3. The workflow validates the record and adds it to the Iscritti sheet.
  4. After the scheduled wait, it generates and sends the welcome message through Resend.
  5. The shop reviews the execution and the message received at its test address before using the flow with real contacts.

You obtain a first workflow-generated HTML email for a contact that passed the built-in technical checks.

Informational sequence for a service brand

A service business wants to send a practical tip and a link to its website to new subscribers who provided the required data.

  1. The business configures brand_name and brand_url in the payload sent by its own system.
  2. The workflow saves the record with its source in the Google Sheet.
  3. After the first email, the Wait 3 giorni node keeps the sequence waiting.
  4. The OpenAI: Email Informativa node requests a brief HTML email consistent with the brand.
  5. The Resend node sends the generated content with the received unsubscribe link.

You obtain an informational step in the sequence with a reference to the website supplied in the payload.

Controlled presentation of an offer

A business that already has an offer and its destination page wants to present it to new subscribers without asking the workflow to create the offer or page itself.

  1. The business provides offer_name and offer_url in the webhook payload.
  2. A valid contact moves through the wait nodes and first two sequence stages.
  3. After a further 5 days, the OpenAI: Email Offerta node receives the offer name and URL.
  4. The workflow requests restrained promotional copy without inventing scarcity, discounts, numbers, or results.
  5. The third Resend node sends the third email with the unsubscribe link.

You obtain a message dedicated to the offer supplied by your system, with the destination stated in the payload.

Communications for English recipients

A business uses the same services but wants prompts and customer-facing content to be in English.

  1. Import n8n-email-marketing-ai.en.json instead of the Italian JSON.
  2. Configure the same credentials, Iscritti sheet, sender address, and webhook.
  3. Send a complete payload to a test recipient.
  4. Check English subjects, the Unsubscribe text, and generated HTML content.
  5. Keep node names and expressions unchanged unless you make deliberate, tested changes.

You obtain the same technical sequence with English prompts and recipient-facing content.

Tips

  • Keep testing and production separate: first test the webhook with an address you control.
  • Do not send the payload until you have set up the Google Sheet, OpenAI credential, and all three Resend nodes.
  • Use the Boolean value true for consent whenever possible; it is less ambiguous than the string true.
  • Do not casually rename nodes referenced in workflow expressions, because sending nodes refer to Valida Iscritto and the OpenAI node names.
  • Keep the sheet named Iscritti, or deliberately update the sheetName field if you change it in n8n.
  • Check that the from field configured in each Resend node uses an address permitted by your verified Resend domain.
  • Review prompts and subjects before sending to real recipients, especially if you customize the workflow after import.
  • For English communications, import n8n-email-marketing-ai.en.json rather than translating only the guide; the Italian JSON explicitly asks for Italian output.
  • Protect exports of the configured workflow because they may contain fields where you inserted provider credentials and addresses.
  • Check service terms, privacy, consent, unsubscribe links, and sending practices before activating commercial email.

Troubleshooting

The webhook responds, but no email is sent.

Webhook: Nuovo Iscritto is configured to respond when the request is received, and email is not sent immediately: the first wait is 1 day. Check the n8n execution, the record in the Iscritti sheet, and the Wait 1 giorno node status. Confirm that the payload passed Valida Iscritto.

The execution ends immediately after Valida Iscritto.

The code returns no items when email is empty, consent is not true or the string true, or unsubscribe_url is empty or does not start with http. Send a complete payload, use consent true, and provide a non-empty HTTP or HTTPS unsubscribe URL.

Google Sheets does not append the contact.

The YOUR_SHEET_ID reference may still be unchanged, the Google account may not be authorized, or the Iscritti sheet may not be available in the selected document. Open Salva in Google Sheets, connect an authorized account, enter the correct document identifier, and check the Iscritti sheet and automatic mapping.

An OpenAI node reports missing or invalid credentials.

The three nodes contain the YOUR_OPENAI_CREDENTIAL placeholder. Select or create a valid OpenAI credential in your n8n instance in OpenAI: Email Benvenuto, OpenAI: Email Informativa, and OpenAI: Email Offerta, then make a controlled test.

Resend rejects the sending request.

The key in the Authorization header may still be a placeholder, be invalid, or lack authorization for your account. Replace YOUR_RESEND_API_KEY in all three Invia Email via Resend nodes with your own key and check provider permissions without sharing the key.

The provider does not accept the sender.

YOUR_FROM_EMAIL may not belong to a sending domain verified in Resend. Update the from field in all three nodes with a sender compatible with the verified domain in your Resend account.

The Italian workflow produces Italian text when you need English communications.

All three system prompts in the original JSON explicitly request Italian emails. Import n8n-email-marketing-ai.en.json. This variant includes English prompts, subjects, and unsubscribe text while retaining Italian node labels and sheet name.

The unsubscribe link in the email does not lead to a useful page.

The workflow inserts the received unsubscribe_url value but does not create the page or manage the unsubscribe action. Correct your external system so it creates and sends a working unsubscribe URL relevant to the contact before the webhook call.

Expressions in a sending node cannot find the expected data.

Sending nodes refer by name to Valida Iscritto and the OpenAI nodes; renaming nodes without updating expressions can break those references. Restore the original names or consistently update all affected expressions, then test with a controlled contact.

Limits to know

  • The consent and unsubscribe_url check is only a technical condition. It does not prove consent validity, retain consent evidence, or guarantee compliance with GDPR or other applicable rules.
  • Before sending commercial email, check service terms, privacy notices, lawful basis, unsubscribe handling, recipients, and local requirements. Provide and maintain a working unsubscribe link.
  • AI-generated content may need correction. Always review it before publishing or sending to real recipients, and do not attribute results, urgency, discounts, or unverifiable claims to it.
  • The workflow sends requests to third-party services only when you run it in your own instance; check permissions, costs, limits, and terms for OpenAI, Google, Resend, and n8n in their own documentation and price lists.
  • The English variant states that it received offline and structural checks, not a live import or execution with providers. Test both variants with non-production data before activation.
  • The sequence uses fixed waits of 1, 3, and 5 days. It does not check delivery, opening, or other recipient actions before proceeding.

Frequently asked questions

Which file should I import for an Italian list?

Import n8n-email-marketing-ai.json. Its OpenAI prompts, subjects, and unsubscribe text are in Italian.

Which file should I import for an English list?

Import n8n-email-marketing-ai.en.json. It keeps the same graph but uses English prompts, subjects, and Unsubscribe text; node names and the Iscritti sheet remain Italian.

Which webhook fields are required?

You need a non-empty email, consent set to true or the string true, and a non-empty unsubscribe_url starting with http. If one is missing, no subsequent node proceeds.

When are the three emails sent?

The first is generated after 1 day from contact storage. The second follows after a further 3 days, and the third after a further 5 days.

Does the workflow create an unsubscribe page?

No. It receives unsubscribe_url in the payload and adds it to all three email bodies. You must provide a working external unsubscribe page or process.

Can I use Gmail, SMTP, or SendGrid instead of Resend?

Not with the delivered nodes. The workflow uses three HTTP requests to the Resend API; changing provider requires replacing the three sending nodes.

What is stored in Google Sheets?

After successful validation, the node passes email, name, source, unsubscribe_url, brand_name, brand_url, offer_name, and offer_url to Google Sheets and uses automatic append mapping in the Iscritti sheet.

Can I resell the package files?

No. The delivered README permits personal and commercial use of the workflow but prohibits resale of the file.