I’m having trouble combining two custom modules that I built for an email template in HubSpot. Each module works fine on its own, but when I try to merge them, the layout gets messed up.
I suspect the issue might be related to the <style> tags inside the HTML code, since CSS isn’t allowed in email modules. However, I’m not entirely sure if that’s the root cause or if something else is interfering with the rendering.
I’ve attached screenshots to show how the modules look separately vs. how they appear when combined. Any insights or suggestions on how to properly merge these without breaking the layout would be greatly appreciated!
Most EMail clients won’t render <style>-tags outside of the <head>-tag. Therefore it’s still best-practise to use inline-styling
Best practise for layouts is - unfortunately - still tables instead of <divs>
The majority of clients have problems with flex-box.
My recommendation is to create your desired layout the dnd editor, (send your self a test mail), preview the web-version, inspect the source-code, grab the layout with the hs- classes, paste it into your custom module and go from there.
If you’re looking for “pixel perfect” solutions, I’m recommending to use html-email-templates instead of dnd emails.
To have good (and responsive) template, I recommend to use mjml.io. Once your template is build, you can change the static image/text info to HubSpot modules to have the option to change the content.
Thanks Anton - to be honest, I am not a coder at all, and used CHATGPT to help me build these modules. What would you recommend moving forward? Using MJML for it?