Problem configuring Sendgrid as SMTP Relay Server for Firebase Authentication Email

community!

I'm configuring Sendgrid as SMTP for Firebase Authentication Email but when I try to send an email the server sends it with content-type: text/plain

So the HTML content is not recognized when the user receives it

When default SMTP Firebase service sends the email with Content-Type: multipart/alternative the html content is recognized

So, Why do I need to change the default SMTP firebase service?

Basically, because when SMTP firebase service is set up as sender some emails are not received with a good reputation so they are identified as SPAM so that is why I need to change the SMTP service to Sendgrid.

Current Firebase SMTP configuration

I have looked into the SendGrid documentation but I did not find useful resources for fix this.

I appreciate any ideas.

Upvotes: 2

Views: 780

Answers (1)

JackMcLaughlin
JackMcLaughlin

Reputation: 86

FIREBASE/MAILGUN HTML SETTINGS

  1. Go to https://developers.google.com/oauthplayground
  2. Under "Step 1", select "Firebase Dynamic Links API v1" as the scope
  3. Click "Authorize APIs" and log into the Google Account assocaited with your Firebase App
  4. Under "Step 2", click "Exchange authorization code for tokens"
  5. Under "Step 3", change HTTP method to PATCH
  6. Enter the Request URI https://identitytoolkit.googleapis.com/admin/v2/projects/*{FIREBASE_PROJECT_ID}*/config?updateMask=notification.sendEmail.resetPasswordTemplate.bodyFormat (Add your project ID in there!)
  7. Click "Enter request body" and input {notification:{sendEmail:{resetPasswordTemplate:{bodyFormat: "HTML"}}}} and click "Close" at the bottom.
  8. Click "Send the request"

If you get HTTP/1.1 200 OK within the response, job done. You can now send HTML emails using Firebase using Sendgrid, Mailgun or any other email service!

Upvotes: 6

Related Questions