Problem/Motivation

Today, there does not appear to be any support for Sendgrid's "link branding" feature.

Now, most of what needs to be set up is within Sendgrid's configuration. You need to create CNAME records in your DNS. You need to verify that the configuration and DNS records are working together properly. Once that is done, there are some changes that need to be made that developers need to be aware of:

  1. If you have any links with hrefs coming from the originating site (mydomain.com) you'll likely need to alter them to exclude both protocol (http://) and subdomain (www.).
  2. For any link that is generated by the system, we also need to exclude both protocol and subdomain.
  3. The goal is to provide a url that is just (mydomain.com/bla/bla/bla) so that Sendgrid can handle the branded links appropriately.

Link Branding requirements

Steps to reproduce

  1. Turn on Sendgrid integration for your site
  2. Properly enable link branding on the Sendgrid side of things
  3. Send an email with links (like a user registration email)

Observe that links appear that the come from sendgrid and not the sending website. This alarms users.

Proposed resolution

Our end goal to have links in emails that have the protocol and subdomain removed. We can do this by:

  • Creating new tokens that have protocol and subdomain removed from them.
  • OR
  • Alter existing tokens to remove protocol and subdomain if a new setting is checked.

We'll also have to

  • Update sample test email to use them.
  • Update documentation warning users with link branding that they'll have to use different tokens for things.
  • Get a list of all tokens we

Remaining tasks

  • Decide the approach we want to take
  • Write the code
  • Test the code
  • Ship the code

User interface changes

New admin configuration setting enabling the feature.

Comments

cosmicdreams created an issue. See original summary.

cosmicdreams’s picture

StatusFileSize
new119.34 KB

Uploading image to use in issue description
Sendgrid requirements

cosmicdreams’s picture

Issue summary: View changes
perignon’s picture

Status: Active » Needs work

Pull requests are always welcome if there are any code changes required. I have one production website using this with D9 and I cannot say I have seen a problem with links not coming out correctly in mails since the email is HTML formatted the a hrefs are around text.