Your software
My Mautic version is: 4.0.1
My PHP version is: 7.4.18
My Database type and version is: MariaDB 10.5.9
Your problem
My problem is: After creating a new email with “Code Mode”, editing the HTML, and saving the email, Mautic (or probably GrapesJS) refactor my HTML code and remove my inline CSS to the <style>
tag.
The email is rendered well on Apple Mail and some other known email clients, but it’s not rendered properly on Gmail.
A chunk from my HTML code:
<td
align="center"
bgcolor="#6366F1"
role="presentation"
style="
border: none;
border-radius: 3px;
cursor: auto;
mso-padding-alt: 10px 25px;
background: #6366f1;
"
valign="middle"
>
<a
href="{pagelink=1}"
style="
display: inline-block;
background: #6366f1;
color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
font-weight: normal;
line-height: 1.15;
margin: 0;
text-decoration: none;
text-transform: none;
padding: 10px 25px;
mso-padding-alt: 0px;
border-radius: 3px;
"
target="_blank"
>
Yes, subscribe me to this list.
</a>
</td>
The new HTML after pasting it to the builder:
<td
align="center"
bgcolor="#6366F1"
role="presentation"
valign="middle"
id="idqbp"
>
<a
href="{pagelink=1}"
target="_blank"
id="iirh6"
>
Yes, subscribe me to this list.
</a>
</td>
<style>
#idqbp {
border: none;
border-radius: 3px;
cursor: auto;
mso-padding-alt: 10px 25px;
background: #6366f1;
}
#iirh6 {
display: inline-block;
background: #6366f1;
color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
font-weight: normal;
line-height: 1.15;
margin: 0;
text-decoration: none;
text-transform: none;
padding: 10px 25px;
mso-padding-alt: 0px;
border-radius: 3px;
}
</style>
Apple Mail:
Gmail:
Gmail supports only inline CSS, so all my CSS code was ignored.