Closed campgurus closed 4 years ago
I'm not seeing a group ID in your message. Can you try adding the unsubscribe group ID? Example:
const msg {
...
asm: {
groupId: 12345
},
...
};
Ok that works. Thanks very much. Is that somewhere in the documentation that I simply missed?
There's a little info about the asm
param here: https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/index.html
Ok. I am surprised you don't get more questions about that. Maybe I am the only one though. Thanks for your help.
On Fri, May 1, 2020 at 10:51 AM childish-sambino notifications@github.com wrote:
There's a little info about the asm param here: https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/index.html
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sendgrid/sendgrid-nodejs/issues/1107#issuecomment-622419152, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJTY42NRPYKRDP5OJZXDI3RPLOX7ANCNFSM4MST32MQ .
Just to clarify... what is the secret?
I've added
asm: {
groupId: 12345
},
into the msg object, but I'm getting the same behavior as OP- it adds un-stylable links to the bottom of my email when really I would like them to be centered and have a different background color.
@childish-sambino is this possible?
actually now that I read it again it seems that OP hd a different issue. His "Unsubscribe" text is not clickable whereas mine is...
Hmm not sure this should have been closed. Also ran into this, the docs should really clarify how to get the unsubscribe module to work in dynamic templates.
I am also facing the same issue see my cURL below
curl -X POST \
https://api.sendgrid.com/v3/mail/send \
-H 'authorization: Key' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"personalizations": [
{
"to": [
{
"email": "to email",
"name": "John Doe"
}
],
"dynamic_template_data": {
"name": "John Doe",
"email": "abc@gmail.com",
"message":"Testing something"
},
"subject": "Hello, World!",
"asm": {
"groupId": 16198
}
}
],
"from": {
"email": "as88425@gmail.com",
"name": "Abhay Singh"
},
"reply_to": {
"email": "noreply@johndoe.com",
"name": "John Doe"
},
"template_id": "template id"
}'
i have created unsubscribe group and pass the group id still not working
@abhayciitizen Try putting asm
in the root directory of your POST body
{
"personalizations": [
{
"to": [
{
"email": "to email",
"name": "John Doe"
}
],
"dynamic_template_data": {
"name": "John Doe",
"email": "abc@gmail.com",
"message": "Testing something"
},
"subject": "Hello, World!"
}
],
"asm": {
"groupId": 16198
},
"from": {
"email": "as88425@gmail.com",
"name": "Abhay Singh"
},
"reply_to": {
"email": "noreply@johndoe.com",
"name": "John Doe"
},
"template_id": "template id"
}
Issue Summary
I m using SG's dynamic template feature to send transactional emails in Node/Express. Everything works fin except that instead of including working links, the footer simply prints "Unsubscribe - Unsubscribe Preferences" as plain text which is not clickable.
I have attempted to use Subscription Tracking, which provides a working link for global unsubscribes, but does not allow me to us the subscription groups I set up.
Here is my code for sending mail:
Technical details: