# Mautic & Sendgrid X-SMTPAPI

**URL:** <https://forum.mautic.org/t/mautic-sendgrid-x-smtpapi/22214>\
**Category:** General Discussion\
**Created:** [January 3, 2022, 11:10pm UTC](https://forum.mautic.org/t/mautic-sendgrid-x-smtpapi/22214 "2022-01-03T23:10:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nickbm/32/6488_2.png) [@nickbm](https://forum.mautic.org/u/nickbm)\
**Post date:** [January 3, 2022, 11:10pm UTC](https://forum.mautic.org/t/mautic-sendgrid-x-smtpapi/22214/1 "2022-01-03T23:10:19Z")

</div>

Hi,

I’m trying to integrate Mautic with Sendgrid.  
Sendgrid uses a json-formated X-SMTPAPI header to pass on data. For example, the following data will tell Sendgrid to use the template with id 30fa982b-b51c-47fe-ad7f-235379fcc6ce :

```auto
{
  "filters": {
    "templates": {
      "settings": {
        "enable": 1,
        "template_id": "30fa982b-b51c-47fe-ad7f-235379fcc6ce"
      }
    }
  }
}

```

I tested it and it works. I inserted this header on the email that I wanted to use that template with.

However, I would like to use dynamic elements within that JSON data. For example:

```auto
{
  "sub": {
    "%name%": ["Ben", "Joe"],
    "%role%": ["%sellerSection%", "%buyerSection%"]
  },

```

So basically i wanna do:

“%name%”: ["[firstname]", “[lastname]”],

Where [firstname] and [lastname] are the data that my Mautic database has for the contact.

Is this even possible? Is Dynamic Content helpful with this?

Thanks  
A.
