コード例 #1
0
 public void SendMailNotification(int tenant, string userId, MailNotificationState state)
 {
     try
     {
         MakeRequest("sendMailNotification", new { tenant, userId, state });
     }
     catch (Exception error)
     {
         ProcessError(error);
     }
 }
コード例 #2
0
 private void SendMailErrorNotification(MailDraftData draft, MailNotificationState state = MailNotificationState.SendMessageError)
 {
     try
     {
         // send success notification
         _signalrServiceClient.SendMailNotification(draft.Mailbox.TenantId, draft.Mailbox.UserId, state);
     }
     catch (Exception ex)
     {
         Log.ErrorFormat("Unexpected error with wcf signalrServiceClient: {0}, {1}", ex.Message, ex.StackTrace);
     }
 }
コード例 #3
0
        private void SendMailNotification(MailDraftData draft)
        {
            try
            {
                MailNotificationState state = 0;

                if (!string.IsNullOrEmpty(draft.CalendarIcs))
                {
                    switch (draft.CalendarMethod)
                    {
                    case Defines.ICAL_REQUEST:
                        state = MailNotificationState.SentIcalRequest;
                        break;

                    case Defines.ICAL_REPLY:
                        state = MailNotificationState.SentIcalResponse;
                        break;

                    case Defines.ICAL_CANCEL:
                        state = MailNotificationState.SentIcalCancel;
                        break;
                    }
                }
                if (draft.IsReceipt)
                {
                    state = MailNotificationState.ReadingConfirmed;
                }

                // send success notification
                _signalrServiceClient.SendMailNotification(draft.Mailbox.TenantId, draft.Mailbox.UserId, state);
            }
            catch (Exception ex)
            {
                Log.ErrorFormat("Unexpected error with wcf signalrServiceClient: {0}, {1}", ex.Message, ex.StackTrace);
            }
        }