Skip to main content
Most emails never need this. You describe a change to Mary, and she makes it. Edit Source is for the times you want to change the email’s code yourself, such as adjusting spacing, fixing a layout quirk, or pasting in markup you already have. The code is MJML, the email-building language allGood uses. If it’s new to you, start with What MJML is.
Changing the words in an email is not a code edit. The email’s copy lives in its own document, and the code only points to it. To change a headline or a button label, ask Mary to change the copy. There’s no editor for a copy document yet. See Copy and variants.

Open the code

Open the email and select Edit Source in the left menu, under Author. You see the email’s email.mjml file with line numbers, a check on whether it can be saved, and a preview.
Edit Source for an email, showing the email.mjml code, the check result, and the Upload a file, Save and Save and publish buttons

Edit Source for an email: the code, the check, and the buttons to save it.

If you don’t have permission to edit emails, the screen opens read-only with its buttons turned off, and says so at the top.

Make a change

1

Edit the code

Type in the editor, or select Upload a file to replace the code with an MJML file from your computer. Uploading fills the editor but does not save anything yet.
2

Read the check

A few moments after you stop typing, the box above the editor checks your code. It reads This source would save when the code passes every check a generated email is held to. If it finds a problem, it lists what to fix, and you can’t save until it’s fixed.
3

Look at the preview

Below the editor, the preview shows what saving would produce. Switch between Email and Plain text to see both parts of the message.
The Edit Source preview, with Email and Plain text tabs and the top of the email

The preview shows the email as your code would build it.

Tokens such as {{ asset.copy.content.headline.value }} and {{ person.firstName }} appear as written here. They are filled in when the email is sent. To see real values, use Previewing and testing an email.
4

Save it

Select Save to keep your change as a new version without putting it live. Select Save and publish to save it and publish it in one step. Both buttons stay off until you’ve changed something, and Save and publish needs permission to publish.Saving builds the MJML into the HTML that is sent, and builds the plain-text part from that HTML.
When this works, a message confirms the new version, for example “Saved as v4. Publish it to go live,” and the page shows that version as the latest saved one.

What happens to the live email

Nothing changes in a live email when you save. The email keeps sending its last published version until you publish the new one. Every save is its own version, so you can try a change and undo it by publishing an earlier version. See Publishing and versions.

Good to know

  • It’s the email’s own code. A change here affects this email only. To change every email built from a template, edit the template’s code instead. See Changing an email template.
  • Components can’t be edited by hand. You can view the code behind a component, but changes to one go through Mary.
  • Keep the copy tokens. If you delete a {{ asset.copy… }} token, that text no longer appears in the email, even though it’s still in the copy document.

If the email will not save

If Save stays off, check that you changed something, that you have permission to edit, and that the check above the editor says the source would save. If you’re still stuck, contact support@allgoodhq.com.