public AgentController(IConfiguration configuration, LoanManagementContext dbContext, IMapper mapper, IHostingEnvironment hostingEnvironment) { _configuration = configuration; _dbContext = dbContext; _mapper = mapper; _hostingEnvironment = hostingEnvironment; }
public CustomerController(LoanManagementContext loanManagementContext, IMapper mapper, IHostingEnvironment hostingEnvironment, IConfiguration configuration) { _context = loanManagementContext; _mapper = mapper; _hostingEnvironment = hostingEnvironment; _configuration = configuration; }
public static bool SendEmail(long emailTemplateId, Dictionary <string, string> replacements, string toEmail) { LoanManagementContext _dbContext = new LoanManagementContext(); try { EmailTemplate template = _dbContext.EmailTemplate.FirstOrDefault(x => x.EmailTemplateId == emailTemplateId); if (template != null) { string body = template.Text; replacements.ToList().ForEach(x => { body = body.Replace(x.Key, Convert.ToString(x.Value)); }); // Plug in your email service here to send an email. var msg = new MimeMessage(); msg.From.Add(new MailboxAddress("LoanAgent Admin", "*****@*****.**")); msg.To.Add(new MailboxAddress(toEmail)); //msg.Bcc.Add(new MailboxAddress(template.EmailBcc)); msg.Subject = template.Title; var bodyBuilder = new BodyBuilder(); bodyBuilder.HtmlBody = body; msg.Body = bodyBuilder.ToMessageBody(); using (var smtp = new SmtpClient()) { smtp.Connect("smtp.gmail.com", 465, SecureSocketOptions.SslOnConnect); smtp.Authenticate(credentials: new NetworkCredential("*****@*****.**", "ankit2635")); smtp.Send(msg, CancellationToken.None); smtp.Disconnect(true, CancellationToken.None); } return(true); } return(false); } catch (Exception ex) { return(false); } }
public DashboardController(IConfiguration configuration, LoanManagementContext dbContext, IMapper mapper) { _configuration = configuration; _dbContext = dbContext; _mapper = mapper; }
public AccountController(IConfiguration configuration, LoanManagementContext dbContext) { _dbContext = dbContext; _configuration = configuration; }
public MenuController(LoanManagementContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }