Nearing feature complete for driver auth
This commit is contained in:
@@ -12,11 +12,13 @@ namespace MileageTraker.Web.Email
|
||||
{
|
||||
//private static readonly ILog _logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private readonly string _resetPasswordBody;
|
||||
private readonly string _resetPasswordFromAddress;
|
||||
private readonly string _emaialFromAddress;
|
||||
private readonly string _resetPasswordSubject;
|
||||
|
||||
private readonly string _resetPasswordBody;
|
||||
|
||||
private readonly SmtpClient _smtpClient;
|
||||
private string _initializePasswordSubject;
|
||||
private string _initializePasswordBody;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:System.Object"/> class.
|
||||
@@ -26,9 +28,13 @@ namespace MileageTraker.Web.Email
|
||||
{
|
||||
_smtpClient = new SmtpClient();
|
||||
|
||||
_resetPasswordBody = ConfigurationManager.AppSettings["ResetPasswordBody"];
|
||||
_resetPasswordFromAddress = ConfigurationManager.AppSettings["ResetPasswordFromAddress"];
|
||||
_emaialFromAddress = ConfigurationManager.AppSettings["EmailFromAddress"];
|
||||
|
||||
_resetPasswordSubject = ConfigurationManager.AppSettings["ResetPasswordSubject"];
|
||||
_resetPasswordBody = ConfigurationManager.AppSettings["ResetPasswordBody"];
|
||||
|
||||
_initializePasswordSubject = ConfigurationManager.AppSettings["InitializePasswordSubject"];
|
||||
_initializePasswordBody = ConfigurationManager.AppSettings["InitializetPasswordBody"];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -36,10 +42,16 @@ namespace MileageTraker.Web.Email
|
||||
/// </summary>
|
||||
/// <param name="user">To this user.</param>
|
||||
/// <param name="url">Reset url</param>
|
||||
public void NotifyResetPassword(User user, string url)
|
||||
public void SendResetPassword(User user, string url)
|
||||
{
|
||||
var body = string.Format(_resetPasswordBody, url);
|
||||
_smtpClient.Send(new MailMessage(_resetPasswordFromAddress, user.Email, _resetPasswordSubject, body));
|
||||
_smtpClient.Send(new MailMessage(_emaialFromAddress, user.Email, _resetPasswordSubject, body));
|
||||
}
|
||||
|
||||
public void SendInitializePassword(User user, string url)
|
||||
{
|
||||
var body = string.Format(_initializePasswordBody, url, user.FullName);
|
||||
_smtpClient.Send(new MailMessage(_emaialFromAddress, user.Email, _initializePasswordSubject, body));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user