Password reset email

A time-limited reset button, the address to copy if the button fails, and a highlighted security box for people who didn't ask.

Use for: Forgot-password flow

Compatibility

Compatibility check: 0 errors, 0 warnings, 0 info notes.

Variables

Replace these placeholders with your own values when sending.

  • {user.firstName}
  • {reset.url}
  • {reset.hours}
  • {app.name}

Backend code

$@"<!DOCTYPE html>
<html lang=""en"" xmlns:v=""urn:schemas-microsoft-com:vml"" xmlns:o=""urn:schemas-microsoft-com:office:office"">
  <head>
    <meta charset=""utf-8"">
    <meta name=""viewport"" content=""width=device-width, initial-scale=1"">
    <meta name=""color-scheme"" content=""light dark"">
    <meta name=""supported-color-schemes"" content=""light dark"">
    <title>
      Reset your {app.name} password
    </title>
    <!--[if mso]>
    <xml>
      <o:OfficeDocumentSettings>
        <o:PixelsPerInch>
          96
        </o:PixelsPerInch>
      </o:OfficeDocumentSettings>
    </xml>
    <![endif]-->
    <style>
:root  {
  color-scheme: light dark;
  supported-color-schemes: light dark;
}
 a  {
  color: #b45309;
}
 @media (max-width: 620px)  {
  .px  {
  padding-left: 22px !important;
  padding-right: 22px !important;
}
 .col  {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}
 .h1  {
  font-size: 28px !important;
  line-height: 34px !important;
}
 .hide-sm  {
  display: none !important;
}

}
 @media (prefers-color-scheme: dark)  {
  .page  {
  background: #0c111b !important;
}
 .card  {
  background: #151b27 !important;
}
 .ink  {
  color: #edf1f7 !important;
}
 .muted  {
  color: #a8b2c3 !important;
}
 .line  {
  border-color: #2a3243 !important;
}
 .soft  {
  background: #1c2333 !important;
}

}
</style>
  </head>
  <body class=""page"" style=""margin:0;padding:0;background:#f6f2ec;"">
    <div style=""display:none;max-height:0;overflow:hidden;mso-hide:all;"">
      Your reset link works for {reset.hours} hours.&#8199;&#847;&#8199;&#847;&#8199;&#847;&#8199;&#847;&#8199;&#847;
    </div>
    <table role=""presentation"" width=""100%"" cellpadding=""0"" cellspacing=""0"" class=""page"" style=""background:#f6f2ec;"">
      <tr>
        <td align=""center"" style=""padding:32px 12px;"">
          <!--[if mso]>
          <table role=""presentation"" width=""600"" cellpadding=""0"" cellspacing=""0"">
            <tr>
              <td>
                <![endif]-->
                <table role=""presentation"" width=""100%"" cellpadding=""0"" cellspacing=""0"" style=""max-width:600px;"">
                  <tr>
                    <td class=""px"" style=""padding:0 8px 18px;"">
                      <table role=""presentation"" cellpadding=""0"" cellspacing=""0"">
                        <tr>
                          <td width=""28"" height=""28"" style=""width:28px;height:28px;background:#b45309;border-radius:8px;font-size:0;line-height:0;"">
                            &nbsp;
                          </td>
                          <td class=""ink"" style=""padding-left:10px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:16px;font-weight:bold;letter-spacing:-0.2px;color:#131a2a;"">
                            {app.name}
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <tr>
                    <td class=""card"" style=""background:#ffffff;border-radius:18px;"">
                      <table role=""presentation"" width=""100%"" cellpadding=""0"" cellspacing=""0"">
                        <tr>
                          <td style=""height:8px;background:#b45309;border-radius:18px 18px 0 0;font-size:0;line-height:0;"">
                            &nbsp;
                          </td>
                        </tr>
                      </table>
                      <table role=""presentation"" width=""100%"" cellpadding=""0"" cellspacing=""0"">
                        <tr>
                          <td class=""px"" style=""padding:36px 44px 12px;"">
                            <h1 class=""h1 ink"" style=""margin:0 0 14px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:32px;line-height:38px;font-weight:bold;letter-spacing:-0.6px;color:#131a2a;"">
                              Let's set a new password
                            </h1>
                            <p class=""muted"" style=""margin:0 0 18px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:16px;line-height:25px;color:#4d586b;"">
                              Hi {user.firstName}, we got a request to reset your password. The button works for {reset.hours} hours and only once.
                            </p>
                            <table role=""presentation"" cellpadding=""0"" cellspacing=""0"" style=""margin:6px 0 26px;"">
                              <tr>
                                <td>
                                  <!--[if mso]>
                                  <v:roundrect xmlns:v=""urn:schemas-microsoft-com:vml"" xmlns:w=""urn:schemas-microsoft-com:office:word"" href=""{reset.url}"" style=""height:50px;v-text-anchor:middle;width:240px;"" arcsize=""24%"" stroke=""f"" fillcolor=""#b45309"">
                                    <w:anchorlock/>
                                    <center style=""color:#ffffff;font-family:Arial,sans-serif;font-size:16px;font-weight:bold;"">
                                      Choose a new password
                                    </center>
                                  </v:roundrect>
                                  <![endif]-->
                                  <!--[if !mso]>
                                  <!-->
                                  <a href=""{reset.url}"" style=""display:inline-block;background:#b45309;color:#ffffff;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:16px;font-weight:bold;line-height:50px;padding:0 30px;border-radius:12px;text-decoration:none;"">
                                    Choose a new password
                                  </a>
                                  <!--<![endif]-->
                                </td>
                              </tr>
                            </table>
                            <p class=""muted"" style=""margin:0 0 14px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:20px;color:#7a8597;"">
                              If the button doesn't work, paste this address into your browser:
                            </p>
                            <table role=""presentation"" width=""100%"" cellpadding=""0"" cellspacing=""0"" style=""margin:0 0 24px;"">
                              <tr>
                                <td class=""soft"" style=""padding:14px 16px;background:#f4f5f8;border-radius:10px;font-family:'Courier New',Courier,monospace;font-size:13px;line-height:20px;color:#131a2a;word-break:break-all;"">
                                  <a href=""{reset.url}"" style=""color:#b45309;"">
                                    {reset.url}
                                  </a>
                                </td>
                              </tr>
                            </table>
                            <table role=""presentation"" width=""100%"" cellpadding=""0"" cellspacing=""0"" style=""margin:0 0 22px;"">
                              <tr>
                                <td class=""soft"" style=""padding:18px 20px;background:#fdf3e4;border-left:4px solid #b45309;border-radius:0 10px 10px 0;"">
                                  <p class=""ink"" style=""margin:0 0 4px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-weight:bold;color:#131a2a;"">
                                    Didn't ask for this?
                                  </p>
                                  <p class=""muted"" style=""margin:0;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:21px;color:#4d586b;"">
                                    You don't need to do anything; your password stays the same. If these keep arriving, review your account security.
                                  </p>
                                </td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <tr>
                    <td class=""px muted"" style=""padding:22px 44px 0;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:12px;line-height:19px;color:#7a8597;"">
                      For your security, never share this link. {app.name} will never ask for your password.
                    </td>
                  </tr>
                </table>
                <!--[if mso]>
              </td>
            </tr>
          </table>
          <![endif]-->
        </td>
      </tr>
    </table>
  </body>
</html>"