Dec 2, 2020 5:00 PM
Hello,
I have created a custom property called category_total using the portal dashboard. I am trying to set this value in an email template and send the email using the single send email API as specified in documentation here:
https://developers.hubspot.com/docs/api/marketing/transactional-emails
i.e. POST to https://api.hubapi.com/marketing/v3/transactional/single-email/send using my API key
I have tried using the following JSON as specified by other posts I have seen in the forum:
{
"emailId":38143921416,
"message":{
"to":"dcornell@gmail.com"
},
"contactProperties":[
{
"name":"firstName",
"value":"Bubba"
}
],
"customProperties":[
{
"name":"category_total",
"value":"4071434"
}
]
}
When using this format, I get the following error returned from the API:
Solved! Go to Solution.
Dec 4, 2020 12:42 AM
Dec 4, 2020 11:54 AM
That was it. So I guess there is a difference between a "custom property" and a "self made property" as you call it? Somewhat confusing but it gets me over this hurdle. Thanks!
Dec 5, 2020 1:31 AM
Well I agree that this was confusing and missleading. Maybe @dennisedson can forward the information to someone in charge of API documentation to cleary things for future matter in the documentation. Happy the problem got solved - have a nice weekend @dcornelljames
Dec 7, 2020 10:55 AM
Thanks @MichaelC , I alerted the team 😃
Dec 4, 2020 12:42 AM
Dec 3, 2020 4:02 PM
Im not sure you are naming your custom property correctly, it might be a guess but at least we can do a lookup to confirm if it is or not.
Have you checked the property system name in the email?
Go to your email in the marketing tab > open email in edit mode > click settings > scroll down to plain text and web version > click "customize" button. The name within the brackets {{ }} is the official system name for your property.
Thats my primary guess for now anyway - hope it helps!
Dec 3, 2020 11:57 PM
My template is one of the defaults with my custom parameter inline. This is what the text of the email is using the instructions you have mentioned:
---------
Hello {{contact.firstname}},
Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.
{{contact.category_total}}
Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.
Link text
Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.
All the best,
Your full name
Your job title
--------
You will see the custom parameter "contact.category_total" in the middle. You will also see the standard parameter "contact.firstname" at the top. When I run with the below JSON, the contact.firstname gets populated with Bubba, but the custom parameter does not.
Dec 3, 2020 2:47 PM
Hi @dcornelljames ,
Thanks for adding the question!
@RiccardoPisani , @thesnappingdog , @MichaelC would any of you be able to lend a hand here?