APIs & Integrations

ESmithNous
Member

Transactional Emails not working as expected

I'm trying to follow the example in this documentation when sending a transactional email

https://developers.hubspot.com/beta-docs/guides/api/marketing/emails/single-send-api#custompropertie...

 

We are calling it like this using the Typescript SDK

 

 

await client.marketing.transactional.singleSendApi.sendEmail({
    emailId,
    message: { to: "hello@company.com" },
    customProperties: {
    exampleArray: [
      { firstKey: "someValue", secondKey: "anotherValue" },
      { firstKey: "value1", secondKey: "value2" },
    ],
  },
})

 

 


I've attached a screenshot of the results I get. I expected to see a bulleted list as in the example but I don't.  Does anyone know why?

 

image.png

The last line is the result of adding the following to the programmable module

 

 

{{custom.exampleArray}}

 

 

 

1 Reply 1
PamCotton
Community Manager
Community Manager

Transactional Emails not working as expected

Hey @ESmithNous , thank you for sharing your code snippet and context!

 

 It looks like you’re on the right track with custom properties, but the issue might be with how the exampleArray is being rendered in the email template. To display it as a bulleted list, you might need to iterate over the array within the template itself.

Try using something like this in your programmable module to loop through exampleArray:

 

{% for item in custom.exampleArray %}  - {{ item.firstKey }}: {{ item.secondKey }} {% endfor %}

 

This should help display each item as a list. Let us know if this resolves it. To our top experts @DEsteva and @Anton any other recommendation for @ESmithNous matter?

 

Thank you,

Pam

Você sabia que a Comunidade está disponível em outros idiomas?
Participe de conversas regionais, alterando suas configurações de idioma !


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 Upvotes