Support bypass_list_management param when sending emails via Sendgrid

Feature:

Support bypass_list_management param when sending emails via Sendgrid

Description:

Sendgrid is our email provider for marketing, newsletter and password reset. Some of our users unsubscribe all emails and then are put into a global suppression list. Recently, we noticed that these users cannot receive the password reset email. It’s a serious bug for our product now.

bypass_list_management is the official solution Sendgrid provides for this issue. However, with the current Auth0 settings of Sendgrid, there is no way to specify the bypass_list_management.

Use-case:

This param helps to bypass the suppression (unsubscription) list, so that important emails, like email verification and user password reset, are able to be sent.

Hi there @di1 thanks for the feedback!

We have the same problem. We send a confirmation email to people when they log in by email. This happens a lot. If they have declined all communication from us, they won’t receive it.

This is a show-stopper for us. Can you advise on your next steps to solve this issue?

2 Likes

Hey there!

As of now unfortunately there is still no workaround for this issue but once it’s there we’ll make sure to communicate it here.

This is essential for us too. We’ve just ran into an issue where a customer unsubscribed from all our emails and he is not getting the activation emails nor the forgot password emails sent by Auth0. And we don’t want to manually set a password for them because that goes against our flow and policies.

Hi all - any news on this one? One would expect ensuring account related emails being transactional to be a quite standard use case…

Hey everyone, the workaround we found was to set-up a Custom Email Provider and use the following code snippet:

const sgMail = require("@sendgrid/mail");

/**
 * Handler to be executed while sending an email notification
 * @param {Event} event - Details about the user and the context in which they are logging in.
 * @param {CustomEmailProviderAPI} api - Methods and utilities to help change the behavior of sending a phone notification.
 */
exports.onExecuteCustomEmailProvider = async (event, api) => {
    sgMail.setApiKey(event.secrets.SENDGRID_API_KEY);

    const msg = {
        to: event.notification.to,
        from: event.notification.from,
        subject: event.notification.subject,
        text: event.notification.text,
        html: event.notification.html,
        mail_settings: {
            bypass_list_management: { enable: true },
        },
    };

    try {
        await sgMail.send(msg);
    } catch (error) {
        console.error(error);
        if (error.response) {
            console.error(error.response.body);
        }
        throw error;
    }
};

By doing the API call manually, we were able to customize the call fully and add the bypass_list_management parameter.

Hope this helps.

2 Likes