Search code examples
javascripthtmlcssgmailhtml-email

How to preserve search and save autogenerated Gmail layout class and event code


I am trying to work on a Gmail html layout template. As shown in the snapshot below, the element has a auto generated (I think) class attribute class="MHCHNe lCsUvc aog TbVst aoN" enter image description here

It is due to this class, when I click on the image it shows a pop up to "change image" etc. However once the template is saved (and email sent), later when I open the template, this class and img is replaced by a <div> which has a different class where this image is stored. Like below: enter image description here

Is it possible to find and store the class="MHCHNe lCsUvc aog TbVst aoN" and the corresponding javascript code so later when the template is opened I can edit the image by replacing the class.


Solution

  • You can't construct HTML email this way. It's not designed to work the way you want it to, and, the resultant code is not going to look right when it gets sent to other email clients.

    You need to send through an ESP like MailChimp or SendGrid.