APIs & Integrations

dcornelljames
メンバー

Cannot use HTML list in single-send email

解決

Hi, 

 

I need to create a table with custom values sent through the single send email api.  I am using the contact properties as instructed here 

 

I am also sending the list as HTML as instructed here 

The issue is that no matter what I do, the HTML gets inserted into the email as HTML with all markup escaped.  How do I instruct the property insertion to not escape the HTML and render the table rows?  

 

Thanks in advance.  

0 いいね!
1件の承認済みベストアンサー
MichaelC
解決策
ガイド役 | Solutions Partner
ガイド役 | Solutions Partner

Cannot use HTML list in single-send email

解決

Hi @dcornelljames 

 

This is due to that in JSON (where the code is sent) all tags have been escaped with backlashes "\". You need to strip these backlashes from your code between the response and you printing it onto site. 

 

This is totally depending on the language you code in - but in PHP (which I use) the correct way to do it would be

$response = some_response_from_a_call. 

$html = stripslashes ($response);

 

If you do not code in PHP - please look up similar to stripslashes in your coding language. 

Json needs to be sent with backslash in order not to understand the content as content and not as code. Its a way of transporing your code in a safe way from one place - to the other.



Need further help with integrations or business development?



Want to help me?

Go to the following links and read through the ideas. If you like them - give the idea an upvote

Upvote the following ideas:

元の投稿で解決策を見る

2件の返信
MichaelC
解決策
ガイド役 | Solutions Partner
ガイド役 | Solutions Partner

Cannot use HTML list in single-send email

解決

Hi @dcornelljames 

 

This is due to that in JSON (where the code is sent) all tags have been escaped with backlashes "\". You need to strip these backlashes from your code between the response and you printing it onto site. 

 

This is totally depending on the language you code in - but in PHP (which I use) the correct way to do it would be

$response = some_response_from_a_call. 

$html = stripslashes ($response);

 

If you do not code in PHP - please look up similar to stripslashes in your coding language. 

Json needs to be sent with backslash in order not to understand the content as content and not as code. Its a way of transporing your code in a safe way from one place - to the other.



Need further help with integrations or business development?



Want to help me?

Go to the following links and read through the ideas. If you like them - give the idea an upvote

Upvote the following ideas:

dennisedson
HubSpot製品開発チーム
HubSpot製品開発チーム

Cannot use HTML list in single-send email

解決

Hey @dcornelljames 

Would you mind adding your code here so we can check it out?

Throwing @MichaelC at this as he answered one of the two posts you linked to