Esempio n. 1
0
        public async Task <Status> SendEmailChangedNoticeAsync(string applicationId, string sendTo, string longCode)
        {
            if (!IsValidEmailAddress(sendTo))
            {
                return(NotAnEmailAddress());
            }

            var link   = _urlService.GetCancelChangeLinkUrl(longCode, true);
            var fields = GetCustomFields(applicationId);

            fields["old_email_address"]        = sendTo;
            fields["link_validity_hours"]      = _passwordlessLoginOptions.CancelEmailChangeTimeWindowHours.ToString();
            fields["cancel_email_change_link"] = link;
            return(await _emailTemplateService.SendEmailAsync(PasswordlessLoginConstants.EmailTemplates.EmailChangedNotice, sendTo, fields));
        }