2017-09-13 08:47:34 +02:00
|
|
|
using System.Text.Encodings.Web;
|
2017-09-15 09:06:57 +02:00
|
|
|
using BTCPayServer.Services.Mails;
|
2017-09-13 08:47:34 +02:00
|
|
|
|
|
|
|
namespace BTCPayServer.Services
|
|
|
|
{
|
|
|
|
public static class EmailSenderExtensions
|
|
|
|
{
|
2019-01-06 15:53:37 +01:00
|
|
|
public static void SendEmailConfirmation(this IEmailSender emailSender, string email, string link)
|
2017-09-13 08:47:34 +02:00
|
|
|
{
|
2019-01-06 15:53:37 +01:00
|
|
|
emailSender.SendEmail(email, "Confirm your email",
|
2017-09-13 08:47:34 +02:00
|
|
|
$"Please confirm your account by clicking this link: <a href='{HtmlEncoder.Default.Encode(link)}'>link</a>");
|
|
|
|
}
|
2020-09-05 12:16:48 +02:00
|
|
|
|
|
|
|
public static void SendSetPasswordConfirmation(this IEmailSender emailSender, string email, string link, bool newPassword)
|
|
|
|
{
|
|
|
|
emailSender.SendEmail(email,
|
|
|
|
$"{(newPassword ? "Set" : "Reset")} Password",
|
|
|
|
$"Please {(newPassword ? "set" : "reset")} your password by clicking here: <a href='{link}'>link</a>");
|
|
|
|
}
|
2017-09-13 08:47:34 +02:00
|
|
|
}
|
|
|
|
}
|