public ResultStatusResponse SendEmail(IDbConnection connection, NextStatusRequest request) { ResultStatusResponse response = new ResultStatusResponse(); try { if (request.NextStatusCode == "Complete") { SendEmailComplete(connection, request); } if (request.NextStatusCode == "Rejected") { SendEmailRejected(connection, request); } response.SetSuccessStatus(); } catch (System.Exception ex) { response.SetSuccessStatus(ex.Message.ToString()); } return(response); }
public ResultStatusResponse SendEmail(SaveRequest <MyRow> request) { ResultStatusResponse rs = new ResultStatusResponse(); try { EmailHelper.Send(request.Entity.Subject, request.Entity.Body, request.Entity.To, request.Entity.Cc, null, "*****@*****.**"); rs.SetSuccessStatus("Email has been sent"); } catch (System.Exception) { rs.SetErrorStatus("Email is failed to send"); } return(rs); }
public ResultStatusResponse UpdateNextStatus(IDbConnection connection, NextStatusRequest request) { ResultStatusResponse rs = new ResultStatusResponse(); rs.SetSuccessStatus(); using (var uow = new UnitOfWork(connection)) { if (rs.IsSuccess && request.IsSendEmail && (request.NextStatusCode == "Verified" || request.NextStatusCode == "Rejected")) { rs = SendEmail(connection, request); } if (rs.IsSuccess) { uow.Commit(); } } return(rs); }