/// <summary> /// 给要抄送的人发邮件,主要是人事,所以,在整个外出单审核结束后发送 /// </summary> private List <string> SendMailToHRMailCC() { List <string> mailToList = new List <string>(); foreach (Account account in _HRAccount) { Account innaccount = _AccountBll.GetAccountById(account.Id); mailToList.AddRange(TraineeApplicationUtility.GetMail(innaccount)); } return(mailToList); }
private static void SendSubmitToMail(TraineeApplication traineeApplication) { Account mailToAccount = new TAMailAndPhoneUtility(). GetMailToAccount(traineeApplication, traineeApplication.NextStep); MailBody mailBody = new MailBody(); BuildSubmitMailBody(traineeApplication, mailBody, mailToAccount, true); mailBody.MailTo = TraineeApplicationUtility.GetMail(mailToAccount); _MailGateWay.Send(mailBody); }
private void BuildSubmitMailBody(MailBody mailBody, Account to, bool addConfirmAddress) { string subject = string.Format("ÇëÉóÅú{0}µÄÅàѵÉêÇë", _TraineeApplication.Applicant.Name); StringBuilder mailContent = new StringBuilder(); mailContent.Append(TraineeApplicationMail.BuildBody(_TraineeApplication)); if (addConfirmAddress) { TraineeApplicationMail.BulidConfirmAddress(mailContent, to, _TraineeApplication.PKID); mailBody.MailTo = TraineeApplicationUtility.GetMail(to); } mailBody.Body = mailContent.ToString(); mailBody.Subject = subject; mailBody.IsHtmlBody = true; }
/// <summary> /// 给要抄送的人发邮件,主要是人事,所以,在整个外出单审核结束后发送 /// </summary> private List <string> SendMailToMailCC() { DiyProcess diyProcess = _TraineeApplication.TraineeApplicationDiyProcess; List <string> mailToList = new List <string>(); foreach (Account account in diyProcess.DiySteps[diyProcess.DiySteps.Count - 1].MailAccount) { Account innaccount = _AccountBll.GetAccountById(account.Id); mailToList.AddRange(TraineeApplicationUtility.GetMail(innaccount)); } foreach (Account account in _TraineeApplication.CurrentStep.MailAccount) { Account innaccount = _AccountBll.GetAccountById(account.Id); mailToList.AddRange(TraineeApplicationUtility.GetMail(innaccount)); } return(mailToList); }
private static void SendSubmitCCMail(TraineeApplication traineeApplication, IEnumerable <Account> cclist) { List <string> mailToList = new List <string>(); foreach (Account account in cclist) { Account innaccount = _AccountBll.GetAccountById(account.Id); mailToList.AddRange(TraineeApplicationUtility.GetMail(innaccount)); } if (mailToList.Count > 0) { MailBody mailBody = new MailBody(); BuildSubmitMailBody(traineeApplication, mailBody, null, false); mailBody.MailTo = mailToList; mailBody.Subject = string.Format("³ËÍ£º{0}Ìá½»ÅàѵÉêÇë", traineeApplication.Applicant.Name); _MailGateWay.Send(mailBody); } }
private void SendSubmitCCMail() { List <string> mailToList = new List <string>(); foreach (Account account in _TraineeApplication.CurrentStep.MailAccount) { Account innaccount = _AccountBll.GetAccountById(account.Id); mailToList.AddRange(TraineeApplicationUtility.GetMail(innaccount)); } if (mailToList.Count > 0) { MailBody mailBody = new MailBody(); BuildSubmitMailBody(mailBody, null, false); mailBody.MailTo = mailToList; mailBody.Subject = string.Format("³ËÍ£º{0}ÉóºËͨ¹ý{1}Ìá½»µÄÅàѵÉêÇë", _CurrentAccount.Name, _TraineeApplication.Applicant.Name); _MailGateWay.Send(mailBody); } }
/// <summary> /// 发送审核结束邮件 /// </summary> public void ConfirmOverMail() { if (_TraineeApplication.TraineeApplicationStatuss.Id == TraineeApplicationStatus.ApproveFail.Id || _TraineeApplication.TraineeApplicationStatuss.Id == TraineeApplicationStatus.ApprovePass.Id) { MailBody mailBody = new MailBody(); mailBody.Subject = string.Format("{2}{1}{0}的培训申请单", _TraineeApplication.Applicant.Name, TraineeApplicationUtility.TraineeApplicationStatusDisplay(_TraineeApplication.TraineeApplicationStatuss), _CurrentAccount.Name); StringBuilder body = new StringBuilder(); body.AppendFormat(TraineeApplicationMail.BuildBody(_TraineeApplication)); mailBody.Body = body.ToString(); mailBody.IsHtmlBody = true; mailBody.MailTo = TraineeApplicationUtility.GetMail(_TraineeApplication.Applicant); mailBody.MailCc = SendMailToMailCC(); if (_TraineeApplication.TraineeApplicationStatuss.Id == TraineeApplicationStatus.ApprovePass.Id) { mailBody.MailCc.AddRange(SendMailToHRMailCC()); } _MailGateWay.Send(mailBody); } }