# Use html token with send api

**URL:** <https://forum.mautic.org/t/use-html-token-with-send-api/20185>\
**Category:** Product Support\
**Created:** [July 16, 2021, 8:56am UTC](https://forum.mautic.org/t/use-html-token-with-send-api/20185 "2021-07-16T08:56:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iparker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iparker/32/1936_2.png) [@iparker](https://forum.mautic.org/u/iparker)\
**Post date:** [July 16, 2021, 8:56am UTC](https://forum.mautic.org/t/use-html-token-with-send-api/20185/1 "2021-07-16T08:56:17Z")

</div>

Hello,

I want to output html token content with the rest send api.

I found some github issues/pull-requests for this:

> <https://github.com/mautic/mautic/issues/5933>
>
> I have already tested sending emails with custom tokens, by giving values for th…em in a JSON object ("tokens" =\> ...). What I need to achieve is to include HTML in these custom tokens, a thing that did not work in my tests, as everything is parsed as text. Is there any way at all to achieve this?
> 
> For example, I have a list of products (lets say three products) and I create a detailed list in HTML with them and their thumbnails. I need to attach this code to the "{body}" token in the email template when I make the API request to Mautic.
> 
> Looking forward for your answer!

> <https://github.com/PurHur/mautic/pull/3>
>
> | Q | A
> | --- | ---
> | Bug fix? | 
> | New feature? | Y
> | Automated tests incl…uded? |N
> | Related user documentation PR URL | 
> | Related developer documentation PR URL | 
> | Issues addressed (#s or URLs) | https://github.com/mautic/mautic/issues/5933
> | BC breaks? | N
> | Deprecations? |N 
> 
> \#### Description:
> This PR enables the sendToContact API to send raw html in its tokens. This is often needed for transactional mailings.
> 
> \#### Steps to test this PR:
> 1. Load up \[this PR\](https://mautibox.com)
> 2. Send a html token like this:
> \`\`\`
> $params = \[
> 'tokens' =\> \[
> 'strong\_name' =\> 'rawhtml://\<b\>Strong Man!\</b\>'
> \],
> \];
> $response = $emailApi-\>sendToContact($mailId, $contactId, $params);
> \`\`\`
> 
> \#### List backwards compatibility breaks:
> 1. Only if someone actually sends "rawhttp://" at the beginning of a token.

> <https://github.com/mautic/mautic/pull/8586>
>
> closes #5933
> 
> | Q | A
> | --- | ---
> | Bug fix? | 
> | New feature? | Y 
> | Aut…omated tests included? | N
> | Related user documentation PR URL |
> | Related developer documentation PR URL |
> | Issues addressed (#s or URLs) | https://github.com/mautic/mautic/issues/5933
> | BC breaks? | N
> | Deprecations? |N 
> 
> \#### Description:
> This will allow the send email endpoint to send raw html via the tokens
> 
> \#### Steps to test this PR:
> 1. Load up \[this PR\](https://mautibox.com)
> 2. Send a html token like this:
> \`\`\`
> $params = \[
> 'tokens' =\> \[
> 'strong\_name' =\> 'html://\<b\>Strong Man!\</b\>'
> \],
> \];
> $response = $emailApi-\>sendToContact($mailId, $contactId, $params);
> \`\`\`

But it seems that these pull requests are not merged into the current release?

Has anyone information about this? Thanks for any help!

Best regards,

Timo

---

<div class="post-metadata">

**Author:** ![ruben123](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ruben123/32/9240_2.png) [@ruben123](https://forum.mautic.org/u/ruben123)\
**Post date:** [February 19, 2023, 7:09pm UTC](https://forum.mautic.org/t/use-html-token-with-send-api/20185/2 "2023-02-19T19:09:00Z")

</div>

Hi @iparker , did you find a solution/workaround?
