Trouble Combining Two Custom Modules in HubSpot Email Templates
SOLVE
Hi everyone,
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.
Trouble Combining Two Custom Modules in HubSpot Email Templates
SOLVE
Hey, @talfaropro👋 Can you add your code example directly into the post body? There is a code block tool in the editor.
It's challenging to troubleshoot code from only a screenshot (you didn't do anything wrong, I want to give our community members more to work with)
Thanks! — Jaycee
Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success. Don't miss this opportunity to connect and grow—reserve your spot today!
Did you know that the Community is available in other languages? Join regional conversations by changing your language settings !
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.
Trouble Combining Two Custom Modules in HubSpot Email Templates
SOLVE
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?