public MessageTemplateModel ReadForKey(string templateKey) { var template = emailTemplateRepository.Read(t => t.TemplateKey.Equals(templateKey)).FirstOrDefault(); if (template == null) { return(null); } return(template.ToMessageTemplateModel()); }
private void SendResetPasswordEmail(string emailAddress, string token, string templateKey, string baseURL) { var template = _emailTemplateRepo.Read(m => m.TemplateKey.Equals(templateKey)).FirstOrDefault(); if (template == null) { throw new Exception("Reset Password Request email template not found"); } _emailClient.SendTemplateEmail(template.ToMessageTemplateModel(), new List <string>() { emailAddress }, new { resetLink = string.Format("{0}/#/{1}/?t={2}", Configuration.EntreeSiteURL, baseURL, Uri.EscapeDataString(token)) }); }