Beispiel #1
0
        public async Task <InviteInterestResponseViewModel> SaveInviteInterest([FromBody] InviteInterestRequestViewModel request)
        {
            if (ModelState.IsValid)
            {
                var session = await _sessionProvider.Get();

                var result = new { Success = true };
                try
                {
                    var userinviteinterest = new UsersWebsiteInvite_InterestCommand()
                    {
                        Email       = request.Email,
                        Nationality = request.Nationality,
                        FirstName   = request.FirstName,
                        LastName    = request.LastName
                    };
                    await _commandSender.Send(userinviteinterest);

                    sendEmail(userinviteinterest);
                    return(new InviteInterestResponseViewModel
                    {
                        Success = result.Success,
                    });
                }
                catch (Exception ex)
                {
                    return(new InviteInterestResponseViewModel
                    {
                        Success = false
                    });
                }
            }
            else
            {
                return(new InviteInterestResponseViewModel
                {
                    Success = false
                });
            }
        }
Beispiel #2
0
 private void sendEmail(UsersWebsiteInvite_InterestCommand model)
 {
     try
     {
         string siteUrls = _siteUrlsProvider.GetSiteUrl(_siteIdProvider.GetSiteId());
         Email  email    = new Email();
         email.To           = model.Email;
         email.Bcc          = "*****@*****.**";
         email.From         = "*****@*****.**";
         email.TemplateName = "FeelInviteInterestRegistration";
         email.Variables    = new Dictionary <string, object>
         {
             ["useremail"]  = model.Email,
             ["websiteurl"] = "<a href='" + siteUrls + "/signup" + "' style='margin-right:100px; '>" + "<h3>Invite Interest</h3></a>",
             ["subject"]    = "Welcome to feelitLIVE! Activate your account to get started.",
         };
         _emailSender.Send(email);
     }
     catch (Exception ex)
     {
     }
 }