Export Plain Text

Trigger Event #

Now that the editor is set up in your application and users are creating content, it's time to save the resulting Plain Text. Here's how you can export the design's plain text.
mailui.exportPlainText(function (data) { const json = data.json; const text = data.text; console.log(json, text); });

Pass Export Options #

You can also provide specific options to this function as an additional argument. View all options.
mailui.exportPlainText(function (data) { const json = data.json; const text = data.text; console.log(json, text); }, { mergeTags: { first_name: "John", last_name: "Author", } });

Callback Parameters #

PropertyDescriptionType
jsonThis is the JSON of the designJSON
textThis is the full plain text of the designstring

Export Options #

PropertyRequiredDescriptionTypeDefault
mergeTagsNomergeTags allows dynamic content to be injected based on specified variables or data tags within the project.
{
    mergeTags: {
      first_name: "John",
      last_name: "Author",
    }
}
Object
displayConditionsNodisplayCondition allows you to set rules for when and how certain elements or content are displayed, based on conditions like user behavior.
{
    displayConditions: {
      ismen: true,
      iswomen: false,
      ischild: false,
    }
}
Object

Explore Our Email Builder