public async Task SendResetPasswordData(string token, string email)
        {
            var subject     = "Reset password";
            var client      = configuration["client"];
            var clientRoute = "resetPassword";
            var callbackUrl = $"{client}/{clientRoute}?token={token}";
            var message     = GetResetPasswordMessage(callbackUrl);

            await sendEmail.SendEmailAsync(email, subject, message);
        }
        public async Task Run(
            [TimerTrigger("0 05 06 * * *")] TimerInfo myTimer,
            ILogger logger,
            CancellationToken cancellationToken
            )
        {
            var emailContent         = new List <string>();
            var previousCalendarDays = await _calendarDayPersistanceService.RetrieveAsync(cancellationToken);

            if (previousCalendarDays == null)
            {
                emailContent.Add("Unable to retrieve previous calendar days.");
            }
            else
            {
                emailContent.Add("Currently tracking the following instructors/slots:");
                emailContent.Add(string.Empty);

                var distinctIntials = previousCalendarDays.GetDistinctIntials();

                foreach (var initial in distinctIntials)
                {
                    var freeSlotCount = previousCalendarDays.CalculateTotalSlotCountForInstructor(initial);
                    emailContent.Add($"    {initial}: {freeSlotCount} slots");
                }
            }

            emailContent.Add(string.Empty);
            emailContent.Add($"Slot summary: {_appSettings.Value.WebRootUrl}");

            await _sendEmailService.SendEmailAsync("Instructor Scan Status", emailContent, MimeType.Html, cancellationToken);
        }
Exemple #3
0
        public async Task <ApiResponse> GetIdsAsync(string eventId)
        {
            try
            {
                string html = System.IO.File.ReadAllText(@"D:\Training project\Project\FOS2\fos\fos-api\FOS\FOS.API\App_Data\email_template.txt");
                await _sendEmailService.SendEmailAsync(eventId, html);

                return(ApiUtil.CreateSuccessfulResult());
            }
            catch (Exception e)
            {
                return(ApiUtil.CreateFailResult(e.ToString()));
            }
        }
Exemple #4
0
        private async Task SendVerificationCodeAsync(User user)
        {
            try
            {
                var confirmationToken =
                    await userManager.GenerateChangePhoneNumberTokenAsync(user, user.PhoneNumber);

                var emailMessage = new StringBuilder()
                                   .Append($"Your Confirmation Key Is : {confirmationToken}").ToString();

                emailService.SendEmailAsync(user.Email, "Mojito-ServiceDesk Email Confirmation", emailMessage);
            }
            catch (System.Exception ex)
            {
                throw;
            }
        }
Exemple #5
0
 public async Task SendEmailAsync(string email, string subject, string htmlMessage)
 {
     await _sendEmailService.SendEmailAsync(email, subject, htmlMessage);
 }
        public async Task <ActionResult> SendEmail([FromBody] SendEmailRequest sendEmailRequest)
        {
            await _sendEmailService.SendEmailAsync(sendEmailRequest);

            return(Ok());
        }