Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new record of a Queued Email in the system.
 /// <para>Will retrieve a default Email Account Id if the QueuedEmail does not contain one.</para>
 /// </summary>
 /// <param name="queuedEmail"></param>
 public void InsertQueuedEmail(QueuedEmail queuedEmail)
 {
     if (queuedEmail == null) throw new Exception("Invalid QueuedEmail.");
     if(queuedEmail.Id != Guid.Empty) throw new Exception("Can not create a Queue Email with a pre-existing id.");
     queuedEmail.Id = GuidUtil.NewSequentialId();
     queuedEmail.CreatedOn = Common.CurrentTime();
     _conn.Perform(conn => conn.Insert(queuedEmail));
 }
 public Task SendAsync(IdentityMessage message)
 {
     var queuedEmail = new QueuedEmail()
     {
         Subject = message.Subject,
         Body = message.Body,
         From = "*****@*****.**",
         FromName = "noreply",
         To = message.Destination
     };
     return Task.Factory.StartNew(() => _queuedEmailService.InsertQueuedEmail(queuedEmail));
 }
 public Task SendAsync(IdentityMessage message)
 {
     //Queued email. This QueuedEmail won't have an EmailAccountId. The EmailListenerService will retrieve the default EmailAccount.
     var queuedEmail = new QueuedEmail()
     {
         Subject = message.Subject,
         Body = message.Body,
         From = "*****@*****.**",
         FromName = "noreply",
         To = message.Destination
     };
     return Task.Factory.StartNew(() => _queuedEmailService.InsertQueuedEmail(queuedEmail));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Updates a queued email
 /// </summary>
 /// <param name="queuedEmail">Queued email</param>
 /// <exception cref="System.Exception">
 /// Invalid QueuedEmail.
 /// or
 /// Invalid Queued Email Id.
 /// or
 /// Failed to update QueudEmail.
 /// </exception>
 public void UpdateQueuedEmail(QueuedEmail queuedEmail)
 {
     if (queuedEmail == null) throw new Exception("Invalid QueuedEmail.");
     if(queuedEmail.Id == Guid.Empty) throw new Exception("Invalid Queued Email Id.");
     _conn.Perform(conn => conn.Update(queuedEmail, x => x.Id == queuedEmail.Id));
 }