예제 #1
0
        public async Task <bool> AddAppointmentEmail(Appointment appointment)
        {
            if (appointment == null)
            {
                return(false);
            }

            var user = appointment.User;

            var sendUserBody  = EmailGenerator.GenerateAddAppointmentUserEmailTemplate(appointment.Id);
            var sendAdminBody = EmailGenerator.GenerateAddAppointmentEmailTemplate(appointment.Id, appointment.DateofAppointment.ToString(), appointment.PurposeofAppointment, appointment.DateAppointmentMade.ToString(), user.FirstName, user.LastName);

            await emailSender.SendEmailAsync(sendUserBody, "Appointment Added", user.EmailAddress);

            await emailSender.SendEmailAsync(sendAdminBody, "User Added Appointment", "*****@*****.**");

            return(true);
        }