How to customize unsubscribe link in sendgrid mail

To customize the unsubscribe link in SendGrid Mail, you can follow these steps:

Method 1: Using the SendGrid UI

  1. Log in to your SendGrid account and navigate to the Settings tab.
  2. Click on Mail Settings and then select Unsubscribe from the dropdown menu.
  3. In the Unsubscribe Settings section, click on the Edit button next to Unsubscribe Link.
  4. In the Unsubscribe Link field, enter the custom URL you want to use for the unsubscribe link. You can use SendGrid's default unsubscribe link or create your own custom link.
  5. Click Save to save your changes.

Method 2: Using the SendGrid API

  1. Use the SendGrid API to update the unsubscribe link for your email campaign. You can do this by making a PUT request to the /v3/mail/settings/unsubscribe endpoint.
  2. In the request body, include the unsubscribe_link parameter with the custom URL you want to use for the unsubscribe link.
  3. Here's an example of what the request body might look like:
    {
    "unsubscribe_link": "https://example.com/unsubscribe"
    }
  4. Make the request to the SendGrid API to update the unsubscribe link.

Method 3: Using a SendGrid Template

  1. Create a SendGrid template for your email campaign.
  2. In the template, use the {{ unsubscribe_link }} placeholder to insert the unsubscribe link.
  3. When you send the email campaign, SendGrid will replace the placeholder with the custom unsubscribe link you specified in the template.

Tips and Considerations