Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SendGrid Transactional Templates - Address and Unsubscribe Link Broken

Tags:

sendgrid

I've configured several Transactional Templates to be sent from my SendGrid account via their handy Design Tool, which work great!.

However the Address Line and Unsubscribe links on the template footer aren't activated. In an email they display as placeholders, like so

                [Sender_Name]
[Sender_Address], [Sender_City], [Sender_State] 
                [Sender_Zip]

                Unsubscribe << (Not a Hyperlink)

I've followed SendGrid's documentation and configured my account address but am unable to find the solution for this.

Any ideas on this? Thanks for any input or guidance!

like image 891
Clay Banks Avatar asked Oct 13 '18 12:10

Clay Banks


2 Answers

To get the unsubscribe to function you will need to create one or more unsubscribe groups. If you look under the Marketing menu you will see the sub menu to create those. Once you create one it will be assigned an ID number. When you are generating your email you will need to pass that ID value in as part of the EmailMessage object. If you are using V3 of the API you will be looking for SetAsm.

As for the Sender fields, for transactional templates they do not work correctly, as they are meant for marketing campaigns. Your two options are:

  1. Remove the Sender fields from that block in the template. Add a new text block above it with static values.
  2. Download the template into HTML and convert the sender objects into substitution variables. You will then be able to set them in your code when you are creating the email.

GitHub Bug

like image 129
John Harbison Avatar answered Nov 15 '22 09:11

John Harbison


The unsubscribe link will only appear if you create an unsubscribe group and specify it while sending using

      asm: {
        group_id: <the unsubscribe group ID>
      }
like image 30
ehrencrona Avatar answered Nov 15 '22 09:11

ehrencrona