Deepak Sharma
Deepak Sharma

Reputation: 4170

Firebase Authentication Template > Password Reset > getting html tags as it is, not html formatted content

I have 2 firebase project, working separately. I have modified password reset templates in both few week back. I noticed now, one is sending mail with proper html formatted content, while other sending html tag as it is.

I copied 1st template to 2nd project still 2nd one sending html content as it is.

appreciated if someone can help me. (I am using my own SMTP in both).

1st project sends like - Hello Deepak,

2nd project sends like - <p>Hello Deepak,</p>

though template looks like - <p>Hello %DISPLAY_NAME%,</p>

Upvotes: 4

Views: 727

Answers (2)

JackMcLaughlin
JackMcLaughlin

Reputation: 86

FIREBASE/MAILGUN HTML SETTINGS

I've finally worked it out and hope it can help somebody:

  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_PRODJECT_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 Mailgun!

Upvotes: 1

Ryan
Ryan

Reputation: 686

I contacted Firebase's support team about this issue and they pointed out a config that can be set through a REST API call that sets Firebase emails to send as HTML. Here's a script that shows how this can be used.

After making that call and updating Firebase's SMTP settings to send through a 3rd party service, my emails were no longer being sent only as plain text.

Upvotes: 3

Related Questions