I’ve created a single-send email, used {{ custom.tracking_number }} in a raw HTML block, published it, and sent a POST to /email/public/v1/singleEmail/send with that custom property, and I still get MISSING_TEMPLATE_PROPERTIES.
Defining it like so:
body = {
“emailId”: 189265578342,
“message”: {
“to”: “jdevogel@arborwear.com”,
“customProperties”: {
“tracking_number”: “449044304137821”
}
}
}
Try using a known working default property (like {{ contact.firstname }}) in the email temporarily, and send the same request using a contact with a known firstname. If that works, the issue might be with the customProperties.
Your customProperties is in the wrong location in the JSON payload. You currently have it put in the “message” key while it should be at the root:
I formatted your payload to make it easier to see::
{
"emailId": 189265578342,
"message": {
"to": "jdevogel@arborwear.com",
"customProperties": {
"tracking_number": "449044304137821"
}
}
}
Move custom properties outside of message and into the top level of the payload:
{
"emailId": 189265578342,
"message": {
"to": "jdevogel@arborwear.com"
},
"customProperties": {
"tracking_number": "449044304137821"
}
}
Sample payload from docs:
{
"emailId": 4126643121,
"message": {
"to": "jdoe@hubspot.com"
"sendId": "6"
},
"customProperties": {
"purchaseUrl": "https://example.com/link-to-product",
"productName": "vanilla"
}
}
I figured this out. Default properties worked fine. The documentation was either wrong or inconsistent.
Had to send as a list of objects rather than a dictionary.
This does not work (dictionary - as per docs):
“customProperties”: {
“tracking_number”: tracking_number
}
This does work (list of objects):
“customProperties”: [
{
“name”: “tracking_number”,
“value”: tracking_number
}
]