I have a transactional email template set up and working. However, I can't figure out how to set the tags in the Unsubscribe module -- i.e. [Sender_Name], [Sender_Address], [Sender_City], etc.
Right now when I send an email those tags just appear as text (e.g. "[Sender_Name]") without being swapped out.
I've reviewed the API docs and searched past issues here and can't find any other mention for how to specify values for the "Sender" tags programmatically.
Here's what I've tried:
Is it possible to send that information via the API call? Or is there some other method for specifying this information?
I've received a response back from SendGrid support -- what they said:
I did discover that you can specify an Unsubscribe Group ID via the API fi you want to set that. You can specify it in your message object as:
asm: {
group_id: yourGroupID
}
I spent a full day trying to figure all of this out so I hope SendGrid updates their documentation -- as well as their product -- to clarify these things. And maybe this will save someone else some hours of digging.
Can confirm the exact same issues as described above. Spent lots of time trying to troubleshoot and reading through docs. Can someone from SendGrid please look into this and provide a resolution?
Same problem here.
An example in the docs would be very useful for this case. In our use case, we have a variety of transactional email types that are non-critical (eg. user-relevant data change) and some that are (password reset). We have to be able to offer unsubscribe for the "optional" transactional emails and not for the others.
Got this back from SendGrid support. Leaving it here for those who come looking for support.
Thanks for reaching out to our support team.
This is an issue that we are aware of. Essentially, the root of the problem is that the unsubscribe module offered in the build section of Transactional Templates contains the incorrect syntax. I do apologize for that and I understand completely that this is very confusing. While we are currently working with the product team to work this kink out, I would like to offer a workaround.
Because Transactional Templates utilizes "handlebars" syntax {{ }}, in order to replicate the same sender information being populated you will need to follow these steps:
• Add an unsubscribe module but turn "address line" off.
• Add a text module and use the following syntax to populate it:
{{sender_name}}, {{sender_address}}, {{sender_city}}, {{sender_state}}, {{sender_zip}}
Note: the difference in syntax from the single square brackets to the double curly brackets.
• Adjust your JSON request payload to include the following:"dynamic_template_data": { "subject": "your subject", "sender_name": "John Doe", "sender_address": "Street 123", "sender_city": "City", "sender_state": "ST", "sender_zip": "12345" }Let me know if this helps and if you have any other questions,
Cody | Associate Support Engineer
Got this back from SendGrid support. Leaving it here for those who come looking for support.
Thanks for reaching out to our support team.
This is an issue that we are aware of. Essentially, the root of the problem is that the unsubscribe module offered in the build section of Transactional Templates contains the incorrect syntax. I do apologize for that and I understand completely that this is very confusing. While we are currently working with the product team to work this kink out, I would like to offer a workaround.
Because Transactional Templates utilizes "handlebars" syntax {{ }}, in order to replicate the same sender information being populated you will need to follow these steps:
• Add an unsubscribe module but turn "address line" off.
• Add a text module and use the following syntax to populate it:
{{sender_name}}, {{sender_address}}, {{sender_city}}, {{sender_state}}, {{sender_zip}}
Note: the difference in syntax from the single square brackets to the double curly brackets.
• Adjust your JSON request payload to include the following:"dynamic_template_data": { "subject": "your subject", "sender_name": "John Doe", "sender_address": "Street 123", "sender_city": "City", "sender_state": "ST", "sender_zip": "12345" }Let me know if this helps and if you have any other questions,
Cody | Associate Support Engineer
Hi ,
Any one able to solve this problem.
I am facing the same issue. I have test.html which I try to create campaign through V3 API.
========test.html=====
===============================
I wish to create campaign and schedule it but Getting the error of Unsubscribe tag
If any one solve this can you please share the solution .
Best regards,
Setting the asm property as shown below worked for me.
asm: {
groupId: 111
},
Without the above setting, the links from the Unsubscribe option under Design Editor would just show the 'Unsubscribe' text without URL in emails.
Most helpful comment
I've received a response back from SendGrid support -- what they said:
I did discover that you can specify an Unsubscribe Group ID via the API fi you want to set that. You can specify it in your message object as:
asm: {
group_id: yourGroupID
}
I spent a full day trying to figure all of this out so I hope SendGrid updates their documentation -- as well as their product -- to clarify these things. And maybe this will save someone else some hours of digging.