Is it possible to format the email sent from Firebase sendSignInLinkToEmail?

Viewed 838

Firebase provides email templates for most user email such as password reset but doesn't provide one for the email sent via the sendSignInLinkToEmail method.

It is possible to either customise the content of this email or even better simply get generated link and then use your own email delivery system to sent the email?

1 Answers

You can't modify the built-in templates, however you can make use of the Admin SDKs to generate the action links.

This process is documented here.

const destEmail = 'user@example.com';
admin.auth().generateSignInWithEmailLink(destEmail, actionCodeSettings)
  .then((link) => {
    // Construct sign-in with email link template, embed the link and
    // send using custom SMTP server.
    return sendSignInEmail(destEmail, displayName, link);
  })
  .catch((error) => {
    // Some error occurred.
  });
Related