The "Send Email Editor" dialog inserts field token to the wrong place


Description

When editing the Send Email action in the Send Email Editor dialog, the Insert Field button ignores the cursor position and always inserts the selected field token at the end of the text.

Solution

To solve the issue:

  1. Open the \sitecore\shell\Applications\Modules\Web Forms for Marketers\script\Sitecore.EmailEditor.js file.
  2. Comment out the following lines:
    editor.set_html(Sitecore.EmailEditor.__RAD.scGetValue() + "[<label id='" + element.id + "'>" +
                               element.innerHTML + "</label>]");
  3. Paste the following line instead:
    editor.pasteHtml("[<label id='" + element.id + "'>" + element.innerHTML + "</label>]");
  4. Clear the browser cache.