private bool SendAdminEmail(COMPANY company) { Email email = new Email(); email.To = GetAdminCompany().EMAIL; var body = GlobalSettings.Instance.AdminEmailBody; body = body.Replace("{{companyname}}", company.NAME); body = body.Replace("{{username}}", company.CONTACT_NAME); body = body.Replace("{{accountno}}", company.ACCOUNT_NO); body = body.Replace("{{bsb}}", company.BSB); email.Body = body; email.Subject = GlobalSettings.Instance.UserEmailSubject; return(EmailNotificationUtil.Send(email)); }
private bool SendUserEmail(COMPANY company, USER user, string baseUrl, Email email) { var body = GlobalSettings.Instance.UserEmailBody; body = body.Replace("{{name}}", company.NAME + ","); body = body.Replace("{{username}}", user.USERNAME); body = body.Replace("{{password}}", user.PASSWORD); body = body.Replace("{{accountno}}", company.ACCOUNT_NO); body = body.Replace("{{bsb}}", company.BSB); var activationLink = $"{baseUrl}/api/v1/signup/verify-email/tokens/{user.TOKEN}/users/{user.GUID.ToString().ToLower()}"; body = body.Replace("{{link}}", "Click <a href='" + activationLink + "'>Here</a> to Activate "); email.Body = body; email.Subject = GlobalSettings.Instance.UserEmailSubject; return(EmailNotificationUtil.Send(email)); }
public IHttpActionResult Post(Email email) { var mailSent = EmailNotificationUtil.Send(email); return(Json(mailSent)); }