Export and send your email
dd_emailforge builds the email. Your email service sends it. You export the HTML, paste it into your email service, send yourself a test, and send it to your list from there. dd_emailforge has no send button and doesn't connect to any email service.
Keys, screens, and commands may differ in other versions.
- Press
F3and fix anything it lists (see Preview and validate). - Press
Shift+E. You'll see "Exporting..." and then "✓ Exported" with the path totemplate.html.
Export checks the template first and won't run if there are errors. dd_emailforge writes two files into your template folder, next to template.json:
template.html: the finished email. This is the file you send.template.mjml: the in-between MJML version. You don't need it to send.
If export fails, check that you ran npm install in the template folder (see FAQ), and press F3 to look for errors. If your template uses images from the images/ folder, also set an https:// Base URL in [HEAD].
Open template.html in your browser to see the finished email:
Open template.html in a plain-text editor (such as VS Code, TextEdit in plain-text mode, or gedit), select everything, and copy it. Or copy it straight from the terminal:
# macOS
pbcopy < template.html
# Linux (X11 / Wayland)
xclip -selection clipboard < template.html
wl-copy < template.html
Don't open it in a word processor; that can add extra formatting to the code.
These steps follow Mailchimp's own help pages at the time of writing. Mailchimp notes that custom-coded templates use its legacy builder, and that pasting in your own HTML needs a Standard plan or higher.
- In Mailchimp, click Campaigns, then Email templates.
- Click Code your own, then Continue.
- Paste your HTML into the Edit code field and click Save.
- Open Preview and Test to check how it looks.
- Click Save and Exit, name the template (for example, "ldnddev Monthly Newsletter"), and click Save.
- Find it under the Saved tab and use it to create your email.
Image not captured yet. Mailchimp Email templates page with Code your own selected
Planned file: source/images/emailforge/export-and-send/export-and-send-02-mailchimp-code-your-own.png
Alt text: The Mailchimp Email templates page with the Code your own option selected
Image not captured yet. Mailchimp Edit code field with the exported HTML pasted in and the preview on the right
Planned file: source/images/emailforge/export-and-send/export-and-send-03-mailchimp-paste-code.png
Alt text: The Mailchimp code editor with the exported newsletter HTML pasted in and a preview beside it
Prefer uploading a file? Under Code your own, choose Import HTML and upload template.html.
Merge tags work as-is
Mailchimp merge tags such as *|UNSUB|* pass through dd_emailforge untouched. The email-footer's unsubscribe link uses *|UNSUB|* by default, so Mailchimp fills in each reader's unsubscribe link when you send. You can type other Mailchimp merge tags (for example *|FNAME|* for the reader's first name) into any text field the same way.
Always test before sending to your list. In Mailchimp, open Preview and Test and choose Send a test email. Open the test in the email apps your readers use most, such as Gmail, Outlook, and Apple Mail, on both desktop and phone.
Image not captured yet. Mailchimp Preview and Test menu open with Send a test email highlighted
Planned file: source/images/emailforge/export-and-send/export-and-send-04-mailchimp-test.png
Alt text: The Mailchimp Preview and Test menu with Send a test email highlighted
Check that:
- the logo and all images show (logos must be PNG or JPG, not SVG),
- every link and button goes to the right page, and
- the unsubscribe link works.
dd_emailforge works with any email service that lets you paste or upload your own HTML. Look for an option called something like "custom HTML", "code your own", "HTML editor", or "import HTML". The steps are the same: export, copy template.html, paste it in, test, send.
What to change for a service other than Mailchimp:
- Unsubscribe link.
*|UNSUB|*only works in Mailchimp. In the email-footer, set unsubscribe_href to your service's unsubscribe tag (check your service's help pages for the exact tag), then export again. - Other merge tags. Use your service's own tag format. dd_emailforge passes them through as typed.
- Images. Keep every image on a public
https://address so any service can show it.
Change the template in dd_emailforge, not in your email service. If you edit the HTML inside your email service, those changes are lost the next time you export. dd_emailforge can't import HTML back in.
dd_emailforge export ./ldnddev-monthly # writes template.mjml + template.html in the folder
dd_emailforge export ./ldnddev-monthly --out dist # writes dist/template.mjml + dist/template.html
--outwrites exactly two files,template.mjmlandtemplate.html, and creates the folder if needed. Nothing else is copied (noimages/, no JSON). It printsWrote dist/template.mjmlandWrote dist/template.html.- Export validates first and exits 1 on errors, printing the same messages as
validate. - Export runs the Node
mjmlcompiler (mjml ^5.4.0, installed withnpm install). It doesn't fall back tonpxor another engine. - Relative image paths need an
https://base_url(top-level key, edited in [HEAD]) at export time. template.jsonis the source of truth. There's no MJML or HTML import, so treattemplate.htmlas a build artifact.
Previous: Preview and validate · Next: For developers