Hi guys! I am trying to create a custom module for an email template. The section has two columns and I need both columns to have different background colors. As far as I know, HS editor allows me to modify the entire section background-color, but not the one in each column.
Just trying to find out if there are some materials regarding this topic to help me get this done. The image below is what I currently have, and the other one is what I need.
Unfortunately, you cannot reuse this module in email templates as is. I assume you are also using Bootstrap or another framework for the grid system. While this may function properly in your theme and on your CMS pages, it won't translate well to email templates.
Email templates have significant limitations when it comes to styling. Drag-and-drop email modules do not support 'require_css' or external CSS (and JavaScript) files. Instead, you must utilize inline styles (e.g., 'style=""').
Additionally, in email templates, it's advisable to use tables to position items next to each other, similar to using 'col' classes.
I suggest rebuilding this section in the drag-and-drop email editor and then inspecting the code using development tools to copy it into your new module. You should also create this module for emails only.
As you may have noticed, it's possible to change the background of the entire section in the email editor.
What you could do is create a completely new custom module with two color picker fields. Then, you can apply the background using inline style, for example: style="background-color: {{ module.bg_first_col.color }}".
Since you've already created the section in the email editor, I would suggest copying the entire HTML code of the section using the developer tool and pasting it into the new module. This way, you can save some time.
Thank you for your response. Yes! I did it already, somehow in any landing page that section works fine, however, in any of my emails, that section does not reflect the background color I set at the custom module.
Not sure why. Emaili template may have something set that override that code?
Unfortunately, you cannot reuse this module in email templates as is. I assume you are also using Bootstrap or another framework for the grid system. While this may function properly in your theme and on your CMS pages, it won't translate well to email templates.
Email templates have significant limitations when it comes to styling. Drag-and-drop email modules do not support 'require_css' or external CSS (and JavaScript) files. Instead, you must utilize inline styles (e.g., 'style=""').
Additionally, in email templates, it's advisable to use tables to position items next to each other, similar to using 'col' classes.
I suggest rebuilding this section in the drag-and-drop email editor and then inspecting the code using development tools to copy it into your new module. You should also create this module for emails only.