<p>I've had issues in the past where Twig template errors would cause the HTML email template to fallback to using the default plain text system email template. It's definitely worth checking your <code>web.log</code> file for any errors when the <code>sendPasswordResetEmail</code> method is invoked, if you haven't already.</p>

CC BY-SA 4.0
2019-07-01T17:26:52.020Z
This may have been it because I was testing to see if the ID and CODE vars were accessible in my template. I have since came up with a different way of doing this so I haven't verified this was the actual solution or not but it makes sense.
Rick Kukiela
CC BY-SA 4.0
2019-07-01T08:40:03.690Z
2019-07-01T08:40:03.690Z
Martin Spain
<p>I'm on the latest release of craft 3.x. I have the <code>HTML Email Template</code> setting set to a twig file in my templates folder. When sending a test email the template is used to send the test email, however when I call <code>Craft::$app-&gt;users-&gt;sendPasswordResetEmail($user);</code> from my plugin code, the template file is not used and the default system email template is used. </p>

<p>Is there something I'm missing here?</p>

<plugin-development><emails>
HTML Email Template setting not working for reset password email
# HTML Email Template setting not working for reset password email

(Asked by: username_0 on 2019-06-28)

I'm on the latest release of craft 3.x. I have the `HTML Email Template` setting set to a twig file in my templates folder. When sending a test email the template is used to send the test email, however when I call `Craft::$app->users->sendPasswordResetEmail($user);` from my plugin code, the template file is not used and the default system email template is used.

Is there something I'm missing here?

**Tags:** plugin-development, emails

---

## 1 answers

### Answer by username_1 on 2019-07-01. Score: 2 | Accepted answer

I've had issues in the past where Twig template errors would cause the HTML email template to fallback to using the default plain text system email template. It's definitely worth checking your `web.log` file for any errors when the `sendPasswordResetEmail` method is invoked, if you haven't already.

> **Comments:**
> **username_0**: This may have been it because I was testing to see if the ID and CODE vars were accessible in my template. I have since came up with a different way of doing this so I haven't verified this was the actual solution or not but it makes sense.  

---

