# transactional single-email

**URL:** <https://community.hubspot.com/t/transactional-single-email/61781>\
**Category:** APIs & Integrations\
**Created:** [July 27, 2022, 12:58am UTC](https://community.hubspot.com/t/transactional-single-email/61781 "2022-07-27T00:58:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EYi](https://avatars.discourse-cdn.com/v4/letter/e/0ea827/32.png) [@EYi](https://community.hubspot.com/u/EYi)\
**Post date:** [July 27, 2022, 12:58am UTC](https://community.hubspot.com/t/transactional-single-email/61781/1 "2022-07-27T00:58:22Z")

</div>

Using [https://api.hubapi.com/marketing/v3/transactional/single-email/send](https://api.hubapi.com/marketing/v3/transactional/single-email/send), I want to have a variable/placeholder in the template email and supply the value in the API call. I tried putting

{{ my\_body }}

in the template email and the following in the API call but not working:

“customProperties”: {“my\_body”: “This is a test.”}

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [July 27, 2022, 7:02am UTC](https://community.hubspot.com/t/transactional-single-email/61781/2 "2022-07-27T07:02:57Z")

</div>

Hi @EYi ,

The payload in your API call is correct, however, in the email, you need to specify that you are using a custom token. So instead of using {{ my\_body }} you need to use:

`{{ custom.my_body }}`

Here is my API code that has been tested and works:

```lia-code-sample
 const options = {
 message: {
 to: email,
 },
 customProperties: {
 my_body: 'This is a test',
 },
 emailId: <email ID>
 }

 const url = 'https://api.hubapi.com/marketing/v3/transactional/single-email/send'

 axios({
 method: 'post',
 headers: {accept: 'application/json', 'content-type': 'application/json'},
 url,
 data: JSON.stringify(options),
 json: true
 }).then((response) => {
 resolve(response)
 }).catch((error) => {
 reject(error)
 })

```

---

<div class="post-metadata">

**Author:** ![EYi](https://avatars.discourse-cdn.com/v4/letter/e/0ea827/32.png) [@EYi](https://community.hubspot.com/u/EYi)\
**Post date:** [July 28, 2022, 9:08pm UTC](https://community.hubspot.com/t/transactional-single-email/61781/3 "2022-07-28T21:08:21Z")

</div>

Thank you so much. That worked!
