btcpayserver/BTCPayServer/Extensions/EmailSenderExtensions.cs

22 lines
863 B
C#
Raw Normal View History

2017-09-13 08:47:34 +02:00
using System.Text.Encodings.Web;
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>");
}
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
}
}