# Decode Base64 In Custom Field When Sending Emails

**URL:** <https://forum.mautic.org/t/decode-base64-in-custom-field-when-sending-emails/15500>\
**Category:** Development\
**Created:** [August 4, 2020, 1:19am UTC](https://forum.mautic.org/t/decode-base64-in-custom-field-when-sending-emails/15500 "2020-08-04T01:19:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gary.harrison](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gary.harrison/32/2864_2.png) [@gary.harrison](https://forum.mautic.org/u/gary.harrison)\
**Post date:** [August 4, 2020, 1:19am UTC](https://forum.mautic.org/t/decode-base64-in-custom-field-when-sending-emails/15500/1 "2020-08-04T01:19:05Z")

</div>

I’m saving base64 encoded html in a custom field via the API. I’m looking to add the custom field to a email template and it decode the Base64 when sending emails.

This extension [https://github.com/mtcextendee/mautic-custom-tags-bundle](https://github.com/mtcextendee/mautic-custom-tags-bundle) seems to be what i’m looking for, but the author said he will not be upgrading it to M3.

I have this working when sending emails via a API by adding a prefix to the base64 string…

case “cb64de://”:  
$value = base64\_decode(substr($value, 9));

But cant seem to find where to hack the code for sending email via a template.

Any help is appreciated!
