# Sendgrid substitution tags not working

**URL:** https://discourse.nodered.org/t/sendgrid-substitution-tags-not-working/55812
**Category:** General
**Created:** [28 December 2021 22:39 UTC](https://discourse.nodered.org/t/sendgrid-substitution-tags-not-working/55812 "2021-12-28T22:39:21Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Sebas\_t](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@Sebas\_t](https://discourse.nodered.org/u/Sebas_t)
#### Post date: [28 December 2021 22:39 UTC](https://discourse.nodered.org/t/sendgrid-substitution-tags-not-working/55812/1 "2021-12-28T22:39:21Z")

</div>

Hi,

I'm designing a IoT platform with notification.  
The notifications will be send using the sendgrid and I want to insert data from my platform in the e-mail using substitution tags.

However the email sends just fine only my data never shows up in the actual e-mail.  
Does anyone know what I did wrong?  
I included a data packet that get's passed to the sendgrid node + a picture of the HTML.

With kind regards  
Sébastien

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/6/f63e78da69b1a9031a15706505c2e2692c4ef28f.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/2/52266d9c03865e1a65d40c77e30ba572ac10cffe.png)

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [28 December 2021 22:45 UTC](https://discourse.nodered.org/t/sendgrid-substitution-tags-not-working/55812/2 "2021-12-28T22:45:48Z")

</div>

Which node exactly are you using? Is it a sendgrid node?

---

<div class="post-metadata">

### Author: ![Sebas\_t](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@Sebas\_t](https://discourse.nodered.org/u/Sebas_t)
#### Post date: [28 December 2021 23:12 UTC](https://discourse.nodered.org/t/sendgrid-substitution-tags-not-working/55812/3 "2021-12-28T23:12:12Z")

</div>

Hi,

I'm using the following node.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/6/a6c8696415377fedd25e0513f8ed1f173c8ae8da.png)

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [28 December 2021 23:50 UTC](https://discourse.nodered.org/t/sendgrid-substitution-tags-not-working/55812/4 "2021-12-28T23:50:23Z")

</div>

Looking at its [readme](https://flows.nodered.org/node/node-red-contrib-sendgrid), I don't see any mention of it doing templating of the payload you pass it.

It isn't a node I'm familiar with, so it's possible it has been updated without the readme to match. Does its help text in the editor (under the help sidebar) mention anything about templating?

If not, then you'd have to do the templating before passing to the sendgrid node - for example, using the core Template node.

---

<div class="post-metadata">

### Author: ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)
#### Post date: [29 December 2021 00:02 UTC](https://discourse.nodered.org/t/sendgrid-substitution-tags-not-working/55812/5 "2021-12-29T00:02:34Z")

</div>

Looking at the code it probably should be `​msg​.​templateData​` not `msg.payload.dynamic_template_data`

> <https://github.com/zuhito/node-red-contrib-sendgrid/blob/master/node.js#L22>

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [29 December 2021 00:11 UTC](https://discourse.nodered.org/t/sendgrid-substitution-tags-not-working/55812/6 "2021-12-29T00:11:20Z")

</div>

Thanks Ben. Looks like the readme has fallen a long way behind what the node can do.

---

<div class="post-metadata">

### Author: ![Sebas\_t](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@Sebas\_t](https://discourse.nodered.org/u/Sebas_t)
#### Post date: [29 December 2021 09:05 UTC](https://discourse.nodered.org/t/sendgrid-substitution-tags-not-working/55812/7 "2021-12-29T09:05:44Z")

</div>

Hi,

Thanks for the info this did the trick.  
How did you manage to find the node source code?

With kind regards  
Sébastien

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [29 December 2021 09:10 UTC](https://discourse.nodered.org/t/sendgrid-substitution-tags-not-working/55812/8 "2021-12-29T09:10:34Z")

</div>

In the sidebar of the node's page on [flows.nodered.org](http://flows.nodered.org) is a link labelled "View on GitHub". That takes you to its source code repository.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [12 January 2022 09:10 UTC](https://discourse.nodered.org/t/sendgrid-substitution-tags-not-working/55812/9 "2022-01-12T09:10:54Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
