/// <summary> /// Get a summarized report of sent messages /// </summary> /// <param name="status">Email send status, the possible values are (Queued , Sent and Failed )</param> /// <param name="dateFrom">The start date for the report time interval</param> /// <param name="dateTo">The end date for the report time interval</param> /// <param name="from">Filter report base on from email address</param> /// <param name="subject">Subject of the email , default subject is used unless stated</param> public virtual GetEmailsReportResult GetEmailsReport(EmailStatus? status = null, DateTime? dateFrom = null,DateTime? dateTo = null, string from = null, string subject = null) { var request = new RestRequest(Method.POST) { Resource = "Email/GetEmailsReport" }; if (status.HasValue) request.AddParameter("Status", status.Value); if (dateFrom.HasValue) request.AddParameter("DateFrom", dateFrom.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)); if (dateTo.HasValue) request.AddParameter("DateTo", dateTo.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)); if (from.HasValue()) request.AddParameter("From", from); if (subject.HasValue()) request.AddParameter("Subject", subject); return Execute<GetEmailsReportResult>(request); }
public void VerifyEmail(string FirstName, string MiddleName, string LastName, string Domain) { try { //SingleEmail em = new SingleEmail(FirstName, MiddleName, LastName, Domain); eStatus = new EmailStatus(); eStatus.Email = FirstName + MiddleName + LastName + "@" + Domain; ValidateWithBriteVerify(); Result = true; }catch(Exception e){ Error = e.Message; Result = false; } }
private void UpdateList() { Console.Clear(); GetListOfCustomers(); Console.WriteLine("What is the first name of the customer you are trying to change?"); string ChangeFirstName = Console.ReadLine(); Console.WriteLine("What is the last name of the customer you are trying to change?"); string ChangeLastName = Console.ReadLine(); Console.WriteLine("What would you like to change?\n" + "1. FirstName\n" + "2. Last Name\n" + "3. Type of Customer\n" + "4. Email"); string UserinputFromMenu = Console.ReadLine().ToLower(); switch (UserinputFromMenu) { case "1": case "first name": Console.WriteLine("What is the first name of the customer now?"); string UpdatedFirstName = Console.ReadLine(); _emailRepo.UpdateCustomerListByFirstNameSpecification(ChangeFirstName, ChangeLastName, UpdatedFirstName); break; case "2": case "last name": Console.WriteLine("What is the last name of the customer now?"); string UpdatedLastName = Console.ReadLine(); _emailRepo.UpdateCustomerListByLastNameSpecification(ChangeFirstName, ChangeLastName, UpdatedLastName); break; case "3": case "type": Console.WriteLine("what is the Type of customer?\n" + "1. Potential\n" + "2. Current\n" + "3. Past"); string Userinput = Console.ReadLine().ToLower(); EmailStatus _UpdatedemailStatus = new EmailStatus(); switch (Userinput) { case "1": case "potential": _UpdatedemailStatus = EmailStatus.Potential; break; case "2": case "current": _UpdatedemailStatus = EmailStatus.Current; break; case "3": case "past": _UpdatedemailStatus = EmailStatus.Past; break; } _emailRepo.UpdateCustomerListByTypeSpecification(ChangeFirstName, ChangeLastName, _UpdatedemailStatus); break; case "4": case "email": Console.WriteLine("What is the email address of the customer now?"); string UpdatedEmail = Console.ReadLine(); _emailRepo.UpdateCustomerListByEmailSpecification(ChangeFirstName, ChangeLastName, UpdatedEmail); break; } }
private void UpdateStatus(EmailStatus status) { UpdateStatus(status, null); }
private MailError(EmailStatus type) : base(type.ToString()) { ErrorCounter++; Type = type; }
internal Email(string emailString, EmailType type, EmailStatus status) { EmailString = emailString; Type = type; Status = status; }
private void UpdateStatus(EmailStatus status, ResendEmail email) { UpdateStatus(status, email, null); }
public StartupEmailHostedService(IEmailSender emailSender, EmailStatus emailStatus, ILogger <StartupEmailHostedService> logger) { this.services = services; this.logger = logger; this.emailStatus = emailStatus; }
public void UpdateCustomerListByTypeSpecification(string firstName, string lastName, EmailStatus NewType) { EmailList.Where(w => w.FirstName == firstName && w.LastName == lastName).ToList().ForEach(s => s.EmailStatusOfCustomer = NewType); }
public static Boolean IsWrong(this EmailStatus emailStatus) { return(emailStatus > EmailStatus.EmailSent); }
public async Task OnPost() { EmailStatus = await _mailService.SendAsync(EmailModel); }
public override Tuple <bool, string> Send(Notification notification) { string error = ""; bool skipEmailSetupCheck = false; // if there is no user name, or password specified, then we assume that the default email configuration // setup on the cloud should be used (note that we don't check the smtp server here since there is // always a default value on the clients) if (string.IsNullOrWhiteSpace(base.smtpUsername) && string.IsNullOrWhiteSpace(base.smtpPassword)) { skipEmailSetupCheck = true; } if (skipEmailSetupCheck) { if (string.IsNullOrWhiteSpace(notification.toAddress) || (this.serviceHostUri == null) || string.IsNullOrWhiteSpace(this.serviceHostUri.OriginalString)) { error = "Cannot send email. Email Setup not done correctly"; base.logger.Log(error); return(new Tuple <bool, string>(false, error)); } } else { if (string.IsNullOrWhiteSpace(base.smtpUsername) || string.IsNullOrWhiteSpace(base.smtpServer) || string.IsNullOrWhiteSpace(base.smtpPassword) || string.IsNullOrWhiteSpace(notification.toAddress) || (this.serviceHostUri == null) || string.IsNullOrWhiteSpace(this.serviceHostUri.OriginalString)) { error = "Cannot send email. Email Setup not done correctly"; base.logger.Log(error); return(new Tuple <bool, string>(false, error)); } } try { // TODO: add support for attachments for cloud email relay EmailRequestInfo emailRequestInfo = new EmailRequestInfo( base.smtpUsername, base.smtpPassword, base.smtpServer, notification.toAddress, notification.subject, notification.body, notification.attachmentList ); if (null != emailRequestInfo) { string jsonString = emailRequestInfo.SerializeToJsonStream(); logger.Log("Sending cloud email : {0}", emailRequestInfo.ToString()); WebClient webClient = new WebClient(); webClient.Headers["Content-type"] = "application/json"; webClient.Encoding = Encoding.UTF8; webClient.UseDefaultCredentials = true; string jsonEmailStatus = webClient.UploadString(new Uri(this.serviceHostUri.OriginalString + "/SendEmail"), "POST", jsonString); EmailStatus emailStatus = SerializerHelper <EmailStatus> .DeserializeFromJsonStream(jsonEmailStatus); return(new Tuple <bool, string>(emailStatus.SendStatus == EmailSendStatus.SentSuccessfully, emailStatus.SendFailureMessage)); } } catch (Exception exception) { error = string.Format("Exception while sending cloud email: {0}", exception.ToString()); base.logger.Log(error); return(new Tuple <bool, string>(false, error)); } return(new Tuple <bool, string>(true, "")); }
public String this[EmailStatus exception] => this["Email", exception.ToString()];
public void SetEmailStatus(EmailStatus status) { Status = status; DomainEvents.Add(new EmailStatusChangedEvent()); }
public EmailTemplate Send() { this.Status = EmailStatus.Sent; return this; }
public void UpdateRequestEmailStatus(EmailStatus status) { this.RequestBookEmailStatus = status; }
public EmailTemplate Send() { this.Status = EmailStatus.Sent; return(this); }
/// <summary> /// 更新电子邮件状态 /// </summary> /// <param name="sysNo">电子邮件编号</param> /// <param name="status">状态</param> /// <param name="note">备注</param> public void UpdateEmailStatus(long sysNo, EmailStatus status, string note) { string sql = @"UPDATE [SohoEmailAndSMS].[dbo].[Emails] SET [Status] = @Status, [LastUpdateTime] = GETDATE(), [Note] = ISNULL([Note], N'') + @Note WHERE [SysNo] = @SysNo"; SqlServerDBHelper db = new SqlServerDBHelper(); try { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@SysNo", sysNo), new SqlParameter("@Status", status), new SqlParameter("@Note", note) }; db.ExecuteNonQuery(CommandType.Text, sql, para); } catch (Exception ex) { Logger.WriteException(ex.ToString()); } finally { db.Dispose(); } }
public void MarkAsSent() { EmailStatus = EmailStatus.Sent; }
protected virtual void OnLatestEmailsEvent(EmailStatus e) { this.LatestEmailsEvent?.Invoke(this, e); }
public void SetSendingStatus() { Status = EmailStatus.Sending; LastSendingAttemptTime = DateTime.Now; }
public static MailError WithMessage(EmailStatus type) { return(new(type)); }
public void SetErrorStatus(string error) { Status = EmailStatus.Error; LastSendingError = error; }
public MailError(Exception e) : base("Exception on sending e-mail", e) { ErrorCounter++; Type = EmailStatus.EmailNotSent; }
public void SetSentStatus() { Status = EmailStatus.Sent; }
internal void SetStatus(EmailStatus sent) { this.Status = sent; }
internal MoveResult(Move move, EmailStatus email) : this(move) { Email = email; }
/// <summary> /// 更新电子邮件状态 /// </summary> /// <param name="sysNo">电子邮件编号</param> /// <param name="status">状态</param> /// <param name="note">备注</param> public void UpdateEmailStatus(long sysNo, EmailStatus status, string note = "") { GetDAInstance.UpdateEmailStatus(sysNo, status, note); }
public static Email CreateNew(MimeMessage message, long configId, string uniqueId, EmailType type, EmailStatus status) { var email = new Email { Body = !string.IsNullOrEmpty(message.TextBody) ? message.TextBody : message.HtmlBody, Subject = message.Subject, EmailType = type, HtmlBody = message.HtmlBody, MessageId = message.MessageId, EmailStatus = status, ReadStatus = ReadStatus.Unread, EmailConfigurationId = configId, UniqueId = uniqueId, InReplyTo = message.InReplyTo, Importance = (int)message.Importance, XPriority = (int)message.XPriority, ResentMessageId = message.ResentMessageId, Priority = (int)message.Priority, ResentDate = message.ResentDate.UtcDateTime, Date = message.Date.UtcDateTime, ResentSender = message.ResentSender?.Address }; return(email); }