APIs & Integrations

jsingque
Member

Custom property with apostrophe in subject line

SOLVE

Hi there,

 

I'm currently having a problem with the subject line rendering an apostrophe (') which renders it as ' . The same property renders just fine in the body though.

 

The value is a custom property sent from our API.

0 Upvotes
1 Accepted solution
BarryGrennan
Solution
Top Contributor

Custom property with apostrophe in subject line

SOLVE

How about something like:

 

 

{{ your_property|regex_replace("'", "'") }}

 

Edit: Per the documentation you can't apply filters to personalization tokens in emails. That likely affects what I was suggesting here.

Although in running a quick email test using surnames with apostrophes in them in the subject line, I'm not running into the same issue. Granted that's not through an API though.

View solution in original post

5 Replies 5
BarryGrennan
Top Contributor

Custom property with apostrophe in subject line

SOLVE

Can you use filters like urldecode?


profile2022aBarry Grennan

Freelance HubSpot CMS Developer

Website | Contact

 

 

 

0 Upvotes
jsingque
Member

Custom property with apostrophe in subject line

SOLVE

Hi Barry,

 

Thanks for the reply. Unfortunately, I've tried that, as well as replace and the escape filters. It seems that they are not working as its supposed to.

0 Upvotes
BarryGrennan
Solution
Top Contributor

Custom property with apostrophe in subject line

SOLVE

How about something like:

 

 

{{ your_property|regex_replace("'", "'") }}

 

Edit: Per the documentation you can't apply filters to personalization tokens in emails. That likely affects what I was suggesting here.

Although in running a quick email test using surnames with apostrophes in them in the subject line, I'm not running into the same issue. Granted that's not through an API though.

SStrachan1
Participant

Custom property with apostrophe in subject line

SOLVE

I have the same problem. I tried this above but I cant save the email 

 

{{ personalization_token('contact.workflow_yacht_name|regex_replace("'", "") }}I get the following error:

 

Required fields and warnings

Required fields

  1. The token {{ personalization_token('contact.workflow_yacht_name is incorrectly formatted. A token should look like {{ token }} or {{ personalization_token("token", "default fallback") }}



0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Custom property with apostrophe in subject line

SOLVE

Thanks, @BarryGrennan!

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes