Can I have an image with a replacement tag in a SendGrid template?

I am creating a template in SendGrid and I was trying to put the image in the center, and the URL that I would like to be a tag so that I can dynamically change in my code because it will be from my database.

I tried to just put the tag in the input field, but it does not accept this. Is there a way I can do this?

Thank!

+4
source share
1 answer

I assume that you managed to run the SendGrid API through Node.js, since you tagged the question with an Express tag.

I'm currently trying to create a transactional email template using SendGrid, and I succeeded.

, .

add image

. . .

image file

.

view code

html, . .

replacement code

" ".

replacement tag

. . Node.js- .

mail.personalizations[0].addSubstitution(new helper.Substitution("your-subtitution-tag", "image-url"));

: https://github.com/sendgrid/sendgrid-nodejs , .

email result

- . . , !

+4

Source: https://habr.com/ru/post/1663904/


All Articles