Insert Table in email with personalized variable tokens in HubSpot

Is there a way to add a table into an email that can contain variable tokens?

For example, I am wanting to create a table and insert various preapprovals someone may have which contains their personalized percentage rates/amount.

Hey @JBurks0,
Thanks for posting in the Community!
I’ve been looking into whether this is possible or not, and the only thread I came across that looks to align with your inquiry is this Community thread. I wanted to link it as a potential starting point.
With that in mind, I’d also like to tag in a few Community experts to see what they may recommend. @Anton, @SteveHTM, and @GRajput - any thoughts here?
Shane, Senior Community Moderator

Hey @JBurks0,

I’d say it’s possible, but it requires diving into code.

Something I’d start with is:

  1. create a custom module with your desired table layout (don’t go extra with the table for responsiveness topics)
  2. Enable the programmable E-Mail option in the right sidebar
  3. Add a rich-text field to the module.
  4. Preview the module
  5. Add/Select your desired tokens in the rich-text
  6. Look into the source-code of the rich-text
  7. copy each token from the source code and paste it right into the table code in the module.html view/file

Please note: The big pitfall with tables is, that they’re not responsive and almost every email client(Outlook, Gmail…) will strip every custom css which is not inline-css or inside the <head>-tag (something you can’t access in drag&drop emails).

If you want to be 100% safe (and not use a responsive table), set the table width to 560px (600px is the email width - 2*20px padding on each side by default). With a 2 Column layout, each column would be 260px wide (560px table width - 40px gutter between the columns)…

If you like, you can try doing some calculations with HubL inside the module.html these won’t update the property value itself, but just display the result.

Since you’ve mentioned percentages rates and amount, I assume it’s about money.
Therefore you could think about using the format_currency_value filter right inside the module and link it to the receivers location, if you got an international client base.

hope this helps

best,

Anton