public async Task <ForgotPasswordResponseViewModel> ForgotPassword([FromBody] ForgotPasswordFormDataViewModel model) { if (ModelState.IsValid) { try { var hostName = GetHostName(); var queryResult = await _querySender.Send(new UserSearchQuery { Email = model.Email, ChannelId = Channels.Feel, SignUpMethodId = SignUpMethods.Regular, }); if (queryResult.Success) { Messaging.Models.Emails.Email email = new Messaging.Models.Emails.Email(); email.To = model.Email; email.From = "FeelitLIVE <*****@*****.**>"; email.TemplateName = "FeelResetPassword"; email.Variables = new Dictionary <string, object> { ["passwordresetlink"] = "<a href='https://" + hostName + "/reset-password?" + queryResult.User.AltId.ToString() + "'><img src='https://static1.feelitlive.com/images/feel-mail/choose-password.png' width='231' height='36px' style='border:0' alt='Choose A New Password' /></a>", }; await _accountEmailSender.Send(email); return(new ForgotPasswordResponseViewModel { Success = true, IsExisting = true, }); } else { return(new ForgotPasswordResponseViewModel { Success = true, IsExisting = false, }); } } catch (Exception ex) { _logger.Log(Logging.Enums.LogCategory.Error, ex); return(new ForgotPasswordResponseViewModel { Success = false, IsExisting = false, }); } } else { return(new ForgotPasswordResponseViewModel { Success = false, IsExisting = false, }); } }
private void sendEmail(UserInviteCommand model) { try { string siteUrls = _siteUrlsProvider.GetSiteUrl(_siteIdProvider.GetSiteId()); Email email = new Email(); email.To = model.UserEmail; email.Bcc = "*****@*****.**"; email.From = "FeelitLIVE <*****@*****.**>"; email.TemplateName = "FeelInviteeRegistration"; email.Variables = new Dictionary <string, object> { ["signinlink"] = "<a href='" + siteUrls + "/signup" + "' style='margin-right:100px; '>" + "<h3>feelitLIVE.com</h3></a>", ["userpassword"] = model.UserInviteCode }; _emailSender.Send(email); } catch (Exception ex) { } }
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) { } }
private bool sendEmail(UserInviteCommand model) { try { string siteUrls = _siteUrlsProvider.GetSiteUrl(Contracts.Enums.Site.feelaplaceSite); Email email = new Email(); email.To = model.UserEmail; email.Bcc = "*****@*****.**"; email.From = "FeelitLIVE <*****@*****.**>"; email.TemplateName = "FeelInviteeRegistration"; email.Variables = new Dictionary <string, object> { ["signinlink"] = "<a href='" + siteUrls + "/signup" + "' style='margin-right:100px; '>" + "<h3>feelitLIVE.com</h3></a>", ["userpassword"] = model.UserInviteCode }; _emailSender.Send(email); return(true); } catch (Exception ex) { return(false); } }
public async Task <ApproveModaratePlaceResponseViewModel> ApprovePlace(Guid placeAltID, bool isDeactivate, long eventId, FIL.Contracts.Enums.EventStatus eventStatus) { try { string _host = _httpContextAccessor.HttpContext.Request.Host.Host; var session = await _sessionProvider.Get(); ApproveModeratePlaceCommandResult placeCalendarResult = await _commandSender.Send <ApproveModeratePlaceCommand, ApproveModeratePlaceCommandResult>(new ApproveModeratePlaceCommand { PlaceAltId = placeAltID, IsDeactivateFeels = isDeactivate, EventStatus = eventStatus, EventId = eventId, UpdateAlgolia = (_host.Contains("dev") || _host.Contains("localhost")) ? false : true }); if (placeCalendarResult.MasterEventTypeId == Contracts.Enums.MasterEventType.Online && !isDeactivate && eventStatus == 0) { var url = _siteUrlsProvider.GetSiteUrl(_siteIdProvider.GetSiteId()); Email email = new Email(); email.To = placeCalendarResult.Email; email.From = "FeelitLIVE <*****@*****.**>"; email.TemplateName = "creatoreventapprove"; email.Variables = new Dictionary <string, object> { ["eventimage"] = "<img width='100%' alt='Event banner' src='https://s3-us-west-2.amazonaws.com/feelaplace-cdn/images/places/about/" + placeAltID.ToString().ToUpper() + "-about.jpg' />", ["eventlink"] = !placeCalendarResult.IsTokanize ? $"{url}/place/{placeCalendarResult.ParentCategorySlug}/{placeCalendarResult.Slug}/{placeCalendarResult.SubCategorySlug}" : $"{url}/event/{placeCalendarResult.Slug}/{placeCalendarResult.PlaceAltId.ToString().ToLower()}" }; await _accountEmailSender.Send(email); } if (placeCalendarResult.MasterEventTypeId == Contracts.Enums.MasterEventType.Online && eventStatus == EventStatus.WaitingForApproval && placeCalendarResult.Success && !FIL.Contracts.Utils.Constant.TestEmail.TestEmails.Contains(session.User.Email) && !_host.Contains("localhost") && !_host.Contains("dev") ) { StripeConnectAccountCommandResult EventData = await _commandSender.Send <StripeConnectAccountCommand, StripeConnectAccountCommandResult>(new StripeConnectAccountCommand { AuthorizationCode = "", ExtraCommisionPercentage = 25, ExtraCommisionFlat = 0, channels = Channels.Feel, EventId = placeCalendarResult.PlaceAltId, IsStripeConnect = false, ModifiedBy = session.User != null ? session.User.AltId : Guid.Parse("7390283B-4A32-4860-BA3D-B57F1E5F2DAC") }); List <EmailTemplate> emailTemplates = new List <EmailTemplate>(); emailTemplates.Add(new EmailTemplate { TemplateName = "fapcreateevent", To = EventData.Email }); emailTemplates.Add(new EmailTemplate { TemplateName = "FILSubmitEventForApprovalAlertToCorp", To = "*****@*****.**" }); foreach (var emailTemplate in emailTemplates) { StringBuilder ticketCategories = new StringBuilder(); foreach (var eventTicketDetail in EventData.EventTicketDetail) { var eventTicketAttribute = EventData.EventTicketAttribute.Where(s => s.EventTicketDetailId == eventTicketDetail.Id).FirstOrDefault(); var ticketCategory = EventData.TicketCategories.Where(s => s.Id == eventTicketDetail.TicketCategoryId).FirstOrDefault(); ticketCategories.Append("<tr>"); ticketCategories.Append($"<td style='font-family: Verdana, Geneva, Tahoma, sans-serif; font-size: 14px; line-height: 26px; color: #333;' width='200'>{ticketCategory.Name}: </td> <td style='font-family: Verdana, Geneva, Tahoma, sans-serif; font-size: 14px; line-height: 26px; color: #333;'>{EventData.CurrencyType.Code} {eventTicketAttribute.Price}</td> "); ticketCategories.Append("</tr>"); } Email email = new Email(); email.To = emailTemplate.To; email.From = "FeelitLIVE <*****@*****.**>"; email.TemplateName = emailTemplate.TemplateName; email.Variables = new Dictionary <string, object> { ["eventimage"] = "<img width='100%' alt='Event banner' src='https://s3-us-west-2.amazonaws.com/feelaplace-cdn/images/places/about/" + EventData.Event.AltId.ToString().ToUpper() + "-about.jpg' />", ["eventname"] = EventData.Event.Name, ["eventdatetime"] = $"{EventData.EventDetail.StartDateTime.ToString("MMM dd, yyyy").ToUpper()} {EventData.DayTimeMappings.StartTime}", ["ticketcategories"] = ticketCategories.ToString(), }; await _accountEmailSender.Send(email); } } return(new ApproveModaratePlaceResponseViewModel { Success = true }); } catch (Exception e) { return(new ApproveModaratePlaceResponseViewModel { Success = false }); } }
public async Task <EventDetailsViewModel> SaveEventDetail([FromBody] EventDetailsViewModel model) { if (ModelState.IsValid) { try { var session = await _sessionProvider.Get(); EventDetailsCommandResult eventDetailsCommandResult = await _commandSender.Send <EventDetailsCommand, EventDetailsCommandResult>(new EventDetailsCommand { EventDetail = model.EventDetail, CurrentStep = model.CurrentStep, ModifiedBy = session.User != null ? session.User.AltId : Guid.Parse("7390283B-4A32-4860-BA3D-B57F1E5F2DAC"), }); if (eventDetailsCommandResult.Success) { if (model.EventDetail.EventId == 0 && !FIL.Contracts.Utils.Constant.TestEmail.TestEmails.Contains(session.User.Email) && !_httpContextAccessor.HttpContext.Request.Host.Host.Contains("localhost") && !_httpContextAccessor.HttpContext.Request.Host.Host.Contains("dev") ) { Messaging.Models.Emails.Email email = new Messaging.Models.Emails.Email(); email.To = "*****@*****.**"; email.From = "FeelitLIVE <*****@*****.**>"; email.TemplateName = "FILCreateEventAlertToCorp"; email.Variables = new Dictionary <string, object> { ["eventname"] = eventDetailsCommandResult.EventDetail.Name, ["creatorname"] = session.User.FirstName + " " + session.User.LastName, ["eventlink"] = "https://admin.feelitlive.com/host-online/" + eventDetailsCommandResult.EventDetail.EventId + "/basics", }; await _accountEmailSender.Send(email); } // add user to mailChimp contacts try { var query = await _querySender.Send(new UserSearchQuery { Email = session.User.Email, ChannelId = Channels.Feel, SignUpMethodId = SignUpMethods.Regular, }); await _mailChimpProvider.AddFILMember(new MCUserModel { FirstName = session.User.FirstName, LastName = session.User.LastName, Email = session.User.Email, PhoneCode = session.User.PhoneCode, PhoneNumber = session.User.PhoneNumber, IsCreator = true, SignUpType = "Regular" }, query.Country); } catch (Exception e) { _logger.Log(Logging.Enums.LogCategory.Error, e); } return(new EventDetailsViewModel { Success = true, EventDetail = eventDetailsCommandResult.EventDetail, CurrentStep = eventDetailsCommandResult.CurrentStep, CompletedStep = eventDetailsCommandResult.CompletedStep }); } else { return(new EventDetailsViewModel { }); } } catch (Exception e) { return(new EventDetailsViewModel { }); } } else { return(new EventDetailsViewModel { }); } }
public async Task <OrderConfirmationResponseDataViewModel> GetOrderConfirmation([FromBody] GetOrderConfirmationDataViewModel model) { var utcOffset = ""; var queryResult = await _querySender.Send(new FeelOrderConfirmationQuery { TransactionAltId = model.transactionId, confirmationFrmMyOrders = model.confirmationFromMyOrders, Channel = FIL.Contracts.Enums.Channels.Feel }); try { var serialized = JsonConvert.SerializeObject(queryResult); var query = JsonConvert.DeserializeObject <FeelOrderConfirmationQueryResult>(serialized); query.Transaction.NetTicketAmount = _geoCurrency.Exchange((decimal)query.Transaction.NetTicketAmount, query.CurrencyType.Code); query.Transaction.GrossTicketAmount = _geoCurrency.Exchange((decimal)query.Transaction.GrossTicketAmount, query.CurrencyType.Code); query.Transaction.ServiceCharge = _geoCurrency.Exchange(query.Transaction.ServiceCharge != null ? (decimal)query.Transaction.ServiceCharge : 0, query.CurrencyType.Code); query.Transaction.ConvenienceCharges = _geoCurrency.Exchange(query.Transaction.ConvenienceCharges != null ? (decimal)query.Transaction.ConvenienceCharges : 0, query.CurrencyType.Code); foreach (var item in query.orderConfirmationSubContainer) { foreach (var eventContainer in item.subEventContainer) { foreach (var eta in eventContainer.EventTicketAttribute) { _geoCurrency.eventTicketAttributeUpdate(eta, HttpContext, "USD"); } foreach (var td in eventContainer.TransactionDetail) { _geoCurrency.updateTransactionDetail(td, HttpContext, query.CurrencyType.Id, "USD"); } } } await _mailChimpProvider.AddBuyerOrder(query); var lastEvent = query.orderConfirmationSubContainer.LastOrDefault().subEventContainer.LastOrDefault(); await _mailChimpProvider.AddFILMemberLastDetails(new MailChimp.Models.MCUserAdditionalDetailModel { LastEventName = lastEvent.Event.Name, LastEventTicketCategory = lastEvent.TicketCategory.LastOrDefault().Name, LastPurchaseChannel = queryResult.Transaction.ChannelId, LastPurchaseAmount = queryResult.Transaction.NetTicketAmount.ToString(), LastPurchaseDate = queryResult.Transaction.CreatedUtc.ToString(), LastEventCategory = lastEvent.EventCategory.DisplayName }); } catch (Exception e) { _logger.Log(Logging.Enums.LogCategory.Error, e); } if (Request.Cookies["utcTimeOffset"] != null) { utcOffset = Request.Cookies["utcTimeOffset"]; } try { var onlineStreamLink = ""; if (queryResult.Transaction != null) { var transactionDate = queryResult.Transaction.CreatedUtc; if (utcOffset.Contains("+")) { var hours = Convert.ToInt32(utcOffset.Split(":")[0].Split("+")[1]); var mins = Convert.ToInt32(utcOffset.Split(":")[1]); transactionDate = transactionDate.AddHours(hours).AddMinutes(mins); } else if (utcOffset.Contains("-")) { var hours = Convert.ToInt32(utcOffset.Split(":")[0].Split("-")[1]); var mins = Convert.ToInt32(utcOffset.Split(":")[1]); transactionDate = transactionDate.AddHours(-hours).AddMinutes(-mins); } queryResult.Transaction.CreatedUtc = transactionDate; //Check if order for Hoho if (queryResult.IsHoho) { try { CreateBookingCommandResult createbooking = await _commandSender.Send <CreateBookingCommand, CreateBookingCommandResult>(new CreateBookingCommand { TransactionId = queryResult.Transaction.Id }); } catch (Exception ex) { _logger.Log(FIL.Logging.Enums.LogCategory.Error, ex); } } ConfirmOrderCommandResult confirmOrder = new ConfirmOrderCommandResult(); // for tiqets, Confirm the Order Here if (queryResult.IsTiqets) { try { confirmOrder = await _commandSender.Send <ConfirmOrderCommand, ConfirmOrderCommandResult>(new ConfirmOrderCommand { TransactionId = queryResult.Transaction.Id }); } catch (Exception ex) { _logger.Log(FIL.Logging.Enums.LogCategory.Error, ex); } } if (!queryResult.IsLiveOnline && ((queryResult.IsTiqets && confirmOrder.Success) || !queryResult.IsTiqets)) { _amazonS3FileProvider.UploadImage(queryResult.Transaction.Id.ToString(), ImageType.QrCode); var transactionid = "FAP" + (Convert.ToInt64(queryResult.Transaction.Id) * 6) + "0019" + queryResult.Transaction.Id; StringBuilder strnotes = new StringBuilder(); StringBuilder sbticketdetails = new StringBuilder(); StringBuilder tiqetsPdfDetails = new StringBuilder(); foreach (var orderconfiramtionContainer in queryResult.orderConfirmationSubContainer) { foreach (var subEventContainer in orderconfiramtionContainer.subEventContainer) { foreach (var eventdeliverytypeDetail in subEventContainer.EventDeliveryTypeDetail) { var notes = eventdeliverytypeDetail.Notes; strnotes.Append("<td style = 'font-family:Verdana, Geneva, sans-serif; font-size:11px; line-height:20px; color:#323232; align = 'left'; ' > " + notes + " </td>"); strnotes.Append("<br/>"); } } } string streventname = string.Empty; var transactionDetail = new FIL.Contracts.Models.TransactionDetail(); var transactions = new FIL.Contracts.Models.Transaction(); List <FIL.Contracts.Models.EventAteendeeDetail> eventAttendees = new List <Contracts.Models.EventAteendeeDetail>(); sbticketdetails.Append("<tr>"); sbticketdetails.Append("<td valign=\'top\' align=\'left\'>"); sbticketdetails.Append("<table width=\'100%\' cellspacing=\'0\' cellpadding=\'0\' border=\'0\' align=\'left\'>"); sbticketdetails.Append("<tbody><tr>"); sbticketdetails.Append(" <td style=\'line-height:10px;height:10px;\' valign=\'top\' align=\'left\'> </td>"); sbticketdetails.Append(" </tr>"); sbticketdetails.Append(" <tr>"); sbticketdetails.Append(" <td style=\'font-family:Verdana, Geneva, sans-serif; font-size:12px; line-height:18px; color:#000000;\'>"); sbticketdetails.Append(" <table width=\'100%\' cellspacing=\'0\' cellpadding=\'0\' border=\'0\' align=\'right\'>"); sbticketdetails.Append(" <tbody><tr>"); sbticketdetails.Append(" <td style=\'font-family:Verdana, Geneva, sans-serif; font-size:13px; line-height:18px; color:#000000; font-weight:bold;\' valign=\'top\' align=\'left\'>Your Ticket Details</td>"); sbticketdetails.Append(" </tr>"); foreach (var orderconfiramtionContainer in queryResult.orderConfirmationSubContainer) { string venuename = "", startdatetime = ""; decimal netTicketamount = 0; foreach (var subEventContainer in orderconfiramtionContainer.subEventContainer) { venuename = subEventContainer.Venue.Name.ToString(); foreach (var currentTransactionDetail in subEventContainer.TransactionDetail) { startdatetime = transactionDetail.VisitDate.ToString("MMM dd, yyyy HH:mm").ToUpper(); if (transactionDetail.TransactionType == TransactionType.Itinerary) { startdatetime = transactionDetail.VisitDate.ToString("MMM dd, yyyy").ToUpper(); } netTicketamount = netTicketamount + ((currentTransactionDetail.TotalTickets) * (currentTransactionDetail.PricePerTicket)); transactionDetail = currentTransactionDetail; } } sbticketdetails.Append(" <tr>"); sbticketdetails.Append(" <td style=\'line-height:10px;border-bottom:1px solid #ffffff; height:10px;\' valign=\'top\' align=\'left\'> </td>"); sbticketdetails.Append(" </tr>"); sbticketdetails.Append(" <tr>"); sbticketdetails.Append(" <td style=\'line-height:5px;height:5px;\' valign=\'top\' align=\'left\'> </td>"); sbticketdetails.Append(" </tr>"); sbticketdetails.Append(" <tr>"); sbticketdetails.Append(" <td valign=\'top\' align=\'left\'>"); sbticketdetails.Append(" <table width=\'100%\' cellspacing=\'0\' cellpadding=\'0\' border=\'0\' align=\'right\'>"); sbticketdetails.Append(" <tbody><tr>"); sbticketdetails.Append(" <td style=\'font-family:Verdana, Geneva, sans-serif; font-size:11px; line-height:26px; color:#000000; border-bottom:1px solid #ffffff; font-weight:bold\' width=\'57%\'>" + orderconfiramtionContainer.Event.Name + "</td>"); sbticketdetails.Append(" <td style=\'font-family:Verdana, Geneva, sans-serif; font-size:11px; line-height:26px; color:#000000; border-bottom:1px solid #ffffff; font-weight:bold\' width=\'43%\' align=\'right\'>" + String.Format("{0:0.00}", netTicketamount) + "</td>"); sbticketdetails.Append(" </tr>"); sbticketdetails.Append(" </tbody></table>"); sbticketdetails.Append(" </td>"); sbticketdetails.Append(" </tr>"); sbticketdetails.Append(" <tr>"); sbticketdetails.Append(" <td style=\'font-family:Verdana, Geneva, sans-serif; font-size:11px; line-height:18px; color:#6a6a6a;\'>" + (transactionDetail.TransactionType == TransactionType.Itinerary ? (transactionDetail.VisitDate.Hour + ":" + transactionDetail.VisitDate.Minute + " - " + transactionDetail.VisitEndDate.Hour + ":" + transactionDetail.VisitEndDate.Minute) : transactionDetail.VisitDate.ToString()) + "</td>"); sbticketdetails.Append(" </tr>"); sbticketdetails.Append(" <tr>"); sbticketdetails.Append(" <td style=\'font-family:Verdana, Geneva, sans-serif; font-size:11px; line-height:18px; color:#6a6a6a;\'>" + venuename + "</td>"); sbticketdetails.Append(" </tr>"); foreach (var subEventContainer in orderconfiramtionContainer.subEventContainer) { foreach (var currentTransactionDetail in subEventContainer.TransactionDetail) { var currentEventAttributes = subEventContainer.EventTicketAttribute.ToList().Where(s => s.Id == currentTransactionDetail.EventTicketAttributeId).FirstOrDefault(); var currentEventTicketDetails = subEventContainer.EventTicketDetail.ToList().Where(s => s.Id == currentEventAttributes.EventTicketDetailId).FirstOrDefault(); var currentTicketCategory = subEventContainer.TicketCategory.ToList().Where(s => s.Id == currentEventTicketDetails.TicketCategoryId).FirstOrDefault(); var Category = currentTicketCategory.Name.ToString(); sbticketdetails.Append(" <tr>"); sbticketdetails.Append(" <td style=\'line-height:5px;height:5px;\' valign=\'top\' align=\'left\'> </td>"); sbticketdetails.Append(" </tr>"); sbticketdetails.Append(" <tr>"); sbticketdetails.Append(" <td style=\'line-height:6px;border-bottom:1px solid #ffffff; height:6px;\' valign=\'top\' align=\'left\'> </td>"); sbticketdetails.Append(" </tr>"); sbticketdetails.Append(" <tr>"); sbticketdetails.Append(" <td style=\'line-height:5px;height:5px;\' valign=\'top\' align=\'left\'> </td>"); sbticketdetails.Append(" </tr>"); sbticketdetails.Append(" <tr>"); sbticketdetails.Append(" <td valign=\'top\' align=\'left\'>"); sbticketdetails.Append(" <table width=\'100%\' cellspacing=\'0\' cellpadding=\'0\' border=\'0\' align=\'right\'>"); sbticketdetails.Append(" <tbody><tr>"); sbticketdetails.Append(" <td style=\'font-family:Verdana, Geneva, sans-serif; font-size:11px; line-height:18px; color:#6a6a6a;\'><span style=\'color:#000000\'>" + (currentTransactionDetail.TransactionType == TransactionType.Itinerary ? (currentTransactionDetail.TicketTypeId == 10 ? "Adult" : "Child") : Category) + "</span>" + "(" + currentTransactionDetail.TotalTickets + "x" + queryResult.CurrencyType.Code + " " + String.Format("{0:0.00}", currentTransactionDetail.PricePerTicket) + ")</td>"); sbticketdetails.Append(" <td style=\'font-family:Verdana, Geneva, sans-serif; font-size:11px; line-height:18px; color:#6a6a6a;\' align=\'right\'>" + queryResult.CurrencyType.Code + " " + String.Format("{0:0.00}", (currentTransactionDetail.TotalTickets * currentTransactionDetail.PricePerTicket)) + "</td>"); sbticketdetails.Append(" </tr>"); sbticketdetails.Append(" </tbody></table>"); sbticketdetails.Append(" </td>"); sbticketdetails.Append(" </tr>"); sbticketdetails.Append(" <tr>"); sbticketdetails.Append(" <td style=\'line-height:5px;height:5px;\' valign=\'top\' align=\'left\'> </td>"); sbticketdetails.Append(" </tr>"); sbticketdetails.Append(" </tbody></table>"); sbticketdetails.Append(" </td>"); sbticketdetails.Append(" </tr>"); sbticketdetails.Append(" </tbody></table>"); sbticketdetails.Append(" </td>"); sbticketdetails.Append(" </tr>"); } } if (queryResult.IsTiqets) { tiqetsPdfDetails.Append("<a href=" + confirmOrder.TicketPdfLink + " style=\'font-size:12px;text-decoration: none;padding:10px 10px;display:inline-block;background: #572483;color: #fff;border-radius:5px\';> Get Your Ticket</a>"); } } FIL.Messaging.Models.Emails.Email email = new FIL.Messaging.Models.Emails.Email(); email.To = queryResult.Transaction.EmailId; email.From = "FeelitLIVE <*****@*****.**>"; email.TemplateName = "FeelConfirmationEmail01"; email.ConfigurationSetName = "FIL-Confirmation"; email.Variables = new Dictionary <string, object> { ["sitelogo"] = "<img src='https://static6.feelitlive.com/images/logos/feel-aplace.png'>", ["sitename"] = "feelitlive.com", ["transactionid"] = transactionid, ["datetimestamp"] = _localDateTimeProvider.GetLocalDateTime(queryResult.Transaction.CreatedUtc).ToString("MMM dd, yyyy HH:mm").ToUpper(), ["visitdatetimestamp"] = _localDateTimeProvider.GetLocalDateTime(transactionDetail.VisitDate).ToString("MMM dd, yyyy HH:mm").ToUpper(), ["name"] = queryResult.Transaction.FirstName + " " + queryResult.Transaction.LastName, ["nameoncard"] = queryResult.Transaction.FirstName + " " + queryResult.Transaction.LastName, ["email"] = queryResult.Transaction.EmailId, ["phonenumber"] = queryResult.Transaction.PhoneNumber == "" ? "" : "+" + queryResult.Transaction.PhoneCode + " - " + queryResult.Transaction.PhoneNumber, ["paymentmode"] = queryResult.TransactionPaymentDetail.PaymentOptionId + " - " + queryResult.UserCardDetail.CardTypeId, ["grossticketamount"] = queryResult.CurrencyType.Code + " " + String.Format("{0:0.00}", queryResult.Transaction.GrossTicketAmount), ["conveniencecharges"] = queryResult.CurrencyType.Code + " " + String.Format("{0:0.00}", (queryResult.Transaction.ConvenienceCharges + queryResult.Transaction.ServiceCharge)), ["netamount"] = queryResult.CurrencyType.Code + " " + String.Format("{0:0.00}", queryResult.Transaction.NetTicketAmount), ["notes"] = strnotes.ToString(), ["ticketdetails"] = sbticketdetails.ToString(), ["qrcode"] = "", ["eticketlink"] = "<a href='https://www.feelitlive.com/pah/" + queryResult.Transaction.Id + "'></a>", ["tiqetPdfDetails"] = tiqetsPdfDetails.ToString() }; if (!model.confirmationFromMyOrders) { await _confirmationEmailSender.Send(email); } } //sending email for live online events users else if (queryResult.IsLiveOnline) { var streamDateTimeString = GetStreamDate(queryResult); var transactionid = "FAP" + (Convert.ToInt64(queryResult.Transaction.Id) * 6) + "0019" + queryResult.Transaction.Id; var hostName = HttpContext.Request.Host.ToString(); string host = "https://feelitlive.com/"; if (hostName.Contains("dev")) { host = "https://dev.feelitlive.com/"; } else if (hostName.Contains("demo")) { host = "https://demo.feelitlive.com/"; } string streamLink = (queryResult.ZoomUser != null && queryResult.liveOnlineDetailModel.TicketCategoryId != 19452 && queryResult.liveOnlineDetailModel.TicketCategoryId != 12259) ? host + "stream-online?token=" + queryResult.ZoomUser.AltId.ToString() : ""; var onlinestreaminglink = "<a href='" + streamLink + "'><img src='https://static6.feelitlive.com/images/feel-mail/online-stream-link.png' width='231' height='36px' style='border:0' alt='Online Stream Link' /></a>"; if (queryResult.orderConfirmationSubContainer.FirstOrDefault().Event.Id == 15645) { onlinestreaminglink = onlinestreaminglink + "<div>" + "<div style='font-family:Verdana,Geneva,Tahoma,sans-serif;font-size:14px;line-height:20px;color:#333;font-weight: bold;'>YAKOV SOCIAL MEDIA</div>" + "<a style='margin-right:10px;' href='https://twitter.com/Yakov_Smirnoff' target='_blank'> <img src='https://s3-us-west-2.amazonaws.com/feelaplace-cdn/images/fil-images/social/twitter.png' alt='FIL Twitter' width='20' /></a>" + "<a style='margin-right:10px;text-decoration:none' href='https://m.facebook.com/Yakov.Smirnoff.Comedian/' target='_blank'> <img src='https://feelaplace-cdn.s3-us-west-2.amazonaws.com/images/fil-images/social/facebook.png' alt='FIL Facebook' width='20' /></a>" + "<a style='margin-right:10px;text-decoration:none' href='https://www.instagram.com/yakov_smirnoff/' target='_blank' > <img src='https://s3-us-west-2.amazonaws.com/feelaplace-cdn/images/fil-images/social/instagram.png' alt='FIL Instagram' width='20' /></a>" + "</div>"; } FIL.Messaging.Models.Emails.Email email = new FIL.Messaging.Models.Emails.Email(); email.To = queryResult.Transaction.EmailId; email.From = "FeelitLIVE <*****@*****.**>"; // If Ticket Category is not Donate if (queryResult.ZoomUser != null && queryResult.liveOnlineDetailModel.TicketCategoryId != 19452 && queryResult.liveOnlineDetailModel.TicketCategoryId != 12259) { email.TemplateName = "attendeeorderconfirmation"; email.Variables = new Dictionary <string, object> { ["eventimage"] = "<img style='width:100%;' width='100%' alt='Event banner' src='https://s3-us-west-2.amazonaws.com/feelaplace-cdn/images/places/about/" + queryResult.orderConfirmationSubContainer[0].Event.AltId.ToString().ToUpper() + "-about.jpg' />", ["confirmationnumber"] = transactionid, ["fullname"] = queryResult.Transaction.FirstName + " " + queryResult.Transaction.LastName, ["modeofpayment"] = queryResult.TransactionPaymentDetail.PaymentOptionId, ["email"] = queryResult.Transaction.EmailId, ["phonenumber"] = queryResult.Transaction.PhoneNumber == "" ? "" : "+" + queryResult.Transaction.PhoneCode + " - " + queryResult.Transaction.PhoneNumber, ["subtotal"] = queryResult.CurrencyType.Code + " " + String.Format("{0:0.00}", queryResult.Transaction.GrossTicketAmount - (queryResult.Transaction.DonationAmount == null ? 0 : queryResult.Transaction.DonationAmount)), ["bookingfee"] = queryResult.CurrencyType.Code + " " + String.Format("{0:0.00}", (queryResult.Transaction.ConvenienceCharges + queryResult.Transaction.ServiceCharge)), ["discountamount"] = queryResult.CurrencyType.Code + " " + String.Format("{0:0.00}", (queryResult.Transaction.DiscountAmount == null ? 0 : queryResult.Transaction.DiscountAmount)), ["donationamount"] = queryResult.CurrencyType.Code + " " + String.Format("{0:0.00}", (queryResult.Transaction.DonationAmount == null ? 0 : queryResult.Transaction.DonationAmount)), ["totalamountpaid"] = queryResult.CurrencyType.Code + " " + String.Format("{0:0.00}", queryResult.Transaction.NetTicketAmount), ["bookdatetime"] = transactionDate.ToString("MMM dd, yyyy HH:mm").ToUpper(), ["eventname"] = queryResult.liveOnlineDetailModel.Name, ["onlinestreaminglink"] = onlinestreaminglink, ["streamdatetime"] = streamDateTimeString }; } else if (queryResult.liveOnlineDetailModel.TicketCategoryId == 19452 || queryResult.liveOnlineDetailModel.TicketCategoryId == 12259) { email.TemplateName = "donationconfirmation"; email.Variables = new Dictionary <string, object> { ["eventimage"] = "<img style='width:100%;' width='100%' alt='Event banner' src='https://s3-us-west-2.amazonaws.com/feelaplace-cdn/images/places/about/" + queryResult.orderConfirmationSubContainer[0].Event.AltId.ToString().ToUpper() + "-about.jpg' />", ["confirmationnumber"] = transactionid, ["fullname"] = queryResult.Transaction.FirstName + " " + queryResult.Transaction.LastName, ["modeofpayment"] = queryResult.TransactionPaymentDetail.PaymentOptionId, ["email"] = queryResult.Transaction.EmailId, ["phonenumber"] = queryResult.Transaction.PhoneNumber == "" ? "" : "+" + queryResult.Transaction.PhoneCode + " - " + queryResult.Transaction.PhoneNumber, ["donationamount"] = queryResult.CurrencyType.Code + " " + String.Format("{0:0.00}", (queryResult.Transaction.DonationAmount == null ? 0 : queryResult.Transaction.DonationAmount)), ["totalamountpaid"] = queryResult.CurrencyType.Code + " " + String.Format("{0:0.00}", queryResult.Transaction.NetTicketAmount), ["bookdatetime"] = transactionDate.ToString("MMM dd, yyyy HH:mm").ToUpper(), ["eventname"] = queryResult.liveOnlineDetailModel.Name, ["donate"] = queryResult.CurrencyType.Code + " " + String.Format("{0:0.00}", queryResult.Transaction.NetTicketAmount), }; } await _accountEmailSender.Send(email); onlineStreamLink = streamLink; //Sending email to all hosts foreach (var currentHostUser in queryResult.hostUsersModel) { email.TemplateName = "hostorderconfirmation"; email.To = currentHostUser.email; streamLink = host + "stream-online?token=" + currentHostUser.altId.ToString(); email.Variables = new Dictionary <string, object> { ["eventname"] = queryResult.liveOnlineDetailModel.Name, ["onlinestreaminglink"] = "<a href='" + streamLink + "'><img src='https://static6.feelitlive.com/images/feel-mail/online-stream-link.png' width='231' height='36px' style='border:0' alt='Online Stream Link' /></a>", ["datetime"] = streamDateTimeString }; await _accountEmailSender.Send(email); } } else { return(new OrderConfirmationResponseDataViewModel { }); } } return(new OrderConfirmationResponseDataViewModel { TransactionQrcode = _amazonS3FileProvider.GetImagePath(queryResult.Transaction.Id.ToString(), ImageType.QrCode), Transaction = queryResult.Transaction, TransactionPaymentDetail = queryResult.TransactionPaymentDetail, cardTypes = queryResult.cardTypes, CurrencyType = queryResult.CurrencyType, orderConfirmationSubContainer = queryResult.orderConfirmationSubContainer, PaymentOption = queryResult.PaymentOption, UserCardDetail = queryResult.UserCardDetail, StreamLink = onlineStreamLink }); } catch (Exception ex) { _logger.Log(FIL.Logging.Enums.LogCategory.Error, ex); return(new OrderConfirmationResponseDataViewModel { }); } }