public void SendCancellationRescheduleAppointmentMail(bool isCancelAppointment, long customerId, long eventId, long newEventId, string reason, long orgRoleId, string source, string subReason) { var customer = _customerRepository.GetCustomer(customerId); var eventData = _eventRepository.GetById(eventId); if (eventData.EventDate.Date == DateTime.Today.AddDays(_sendCancelRescheduleNotificationBeforeDays)) { DateTime?newEventDate = null; if (!isCancelAppointment) { var newEventData = _eventRepository.GetById(newEventId); newEventDate = newEventData.EventDate; } var model = _emailNotificationModelsFactory.GetCancelRescheduleAppointmentNotificationViewModel(customer.NameAsString, eventId, newEventId, newEventDate, isCancelAppointment, reason, subReason); _notifier.NotifySubscribersViaEmail(NotificationTypeAlias.CancelRescheduleAppointmentNotification, EmailTemplateAlias.CancelRescheduleAppointmentNotification, model, 0, orgRoleId, source); } }