public async Task <Response> SendEmailResetPasswordAsync(string email, string link, string fullname) { var key = _configuration.GetSection("SendGridService:Key").Value; var client = new SendGridClient(key); var personalize = new Personalization { Substitutions = new Dictionary <string, string> { { ":userFullname", fullname }, { ":resetLink", link } } }; var msg = new SendGridMessage() { From = new EmailAddress("*****@*****.**", "Support Onova"), Subject = "Reset Password Onova", TemplateId = "f5393e0a-75d7-4f1c-9a9c-8d1f36590509", Personalizations = new List <Personalization> { personalize } }; msg.AddTo(new EmailAddress(email)); return(await client.SendEmailAsync(msg)); }
public async Task GivenEmail_SendGridApiCalledCorrectly() { // Arrange var mock = new Mock <ISendGridClient>(); var recipients = new List <string> { "*****@*****.**", "*****@*****.**" }; SendGridMessage sentMessage = null; mock.Setup(m => m.SendEmailAsync(It.IsAny <SendGridMessage>(), It.IsAny <CancellationToken>())) .Callback <SendGridMessage, CancellationToken>((m, _) => sentMessage = m) .ReturnsAsync(new Response(HttpStatusCode.OK, null, null)); // Act var mailSender = new MailSender(mock.Object, new HeyImInConfiguration(), DummyLogger <MailSender>()); const string Subject = "Subject text"; const string Body = "Body text"; await mailSender.SendMailAsync(recipients, Subject, Body); // Assert mock.Verify(m => m.SendEmailAsync(It.IsAny <SendGridMessage>(), It.IsAny <CancellationToken>()), Times.Once); Assert.NotNull(sentMessage); Assert.Null(sentMessage.HtmlContent); Assert.Equal(Body, sentMessage.PlainTextContent); Assert.Single(sentMessage.Personalizations); Personalization emailToBeSent = sentMessage.Personalizations[0]; Assert.NotNull(emailToBeSent); Assert.Equal(Subject, emailToBeSent.Subject); Assert.Equal(recipients, emailToBeSent.Tos.Select(emailAddress => emailAddress.Email)); Assert.Null(emailToBeSent.Bccs); Assert.Null(emailToBeSent.Ccs); }
public static async void Run([QueueTrigger("orderqueue", Connection = "AzureWebJobsStorage")] POCOOrder order, TraceWriter log, [SendGrid(ApiKey = "AzureWebJobsSendGridApiKey")] IAsyncCollector <Mail> outputMessage) { string msg = $"Hello " + order.CustomerName + "! Your order for " + order.ProductName + " with quantity of " + order.OrderCount + " has been shipped."; log.Info(msg); Mail message = new Mail { Subject = msg, From = new Email("*****@*****.**", "No Reply"), ReplyTo = new Email("*****@*****.**", "Prodip Saha") }; var personalization = new Personalization(); // Change To email of recipient personalization.AddTo(new Email(order.CustomerEmail)); Content content = new Content { Type = "text/plain", Value = msg + "Thank you for being such a nice customer!" }; message.AddContent(content); message.AddPersonalization(personalization); await outputMessage.AddAsync(message); }
public override void Initialize(Personalization personalize) { Initialize(); if (VerticalChildren) { VerticalLayoutGroup vlg = this.GetComponent <VerticalLayoutGroup>(); if (vlg) { vlg.spacing = personalize.spaceBetweenRows; } } else { HorizontalLayoutGroup hlg = this.GetComponent <HorizontalLayoutGroup>(); if (hlg) { hlg.spacing = personalize.spaceBetweenRows; } } #if UNITY_EDITOR if (UnityEditor.EditorApplication.isPlaying) { Debug.Log("App.IsPlaying Called initialization of item"); if (children == null) { Debug.Log("Children are null"); children = GetComponentsInChildren <Item>().ToList <ListComponent>(); Debug.Log("Children " + (children == null ? "null" : "true")); Debug.Log("Children count " + children.Count); } if (children != null && children.Count > 0) { foreach (Item i in children) { i.Initialize(personalize); } } } else { if (children == null) { foreach (Item i in this.GetComponentsInChildren <Item>()) { Add(i); } } if (children != null && children.Count > 0) { foreach (Item i in children) { i.Initialize(personalize); } } } #endif }
public static string Run( [ActivityTrigger] OrdiniAcquistoModel ordiniAcquisto, [OrchestrationClient] DurableOrchestrationClient starter, [SendGrid(ApiKey = "SendGridApiKey")] out Mail message) { string currentInstance = Guid.NewGuid().ToString("N"); Log.Information($"InviaMailOrdineCliente : {currentInstance}"); string toMail = Utility.GetEnvironmentVariable("SendGridTo"); string fromMail = Utility.GetEnvironmentVariable("SendGridFrom"); Log.Information($"Invio ordine {ordiniAcquisto.IdOrdine} a {ordiniAcquisto.ClienteCorrente.NumeroTelefono}."); message = new Mail { Subject = $"GlobalAzureBootcamp 2018" }; var personalization = new Personalization(); personalization.AddTo(new Email(toMail)); Content content = new Content { Type = "text/html", Value = $@"L'ordine {ordiniAcquisto.IdOrdine} è stato preso in carico <br><a href='{Utility.GetEnvironmentVariable("PublicUrl")}/ApprovaOrdine?ordineId={ordiniAcquisto.IdOrdine}'>Conferma ordine</a>" }; message.From = new Email(fromMail); message.AddContent(content); message.AddPersonalization(personalization); return(currentInstance); }
public async Task SendMail(IEnumerable <ToUser> toUsers, string subject, string body) { var key = ConfigurationManager.AppSettings["API_KEY"]; var fromAddress = ConfigurationManager.AppSettings["FROM"]; var fromName = ConfigurationManager.AppSettings["FROM_NAME"]; var message = new SendGridMessage(); var client = new SendGridClient(key); var fromUser = new EmailAddress(fromAddress, fromName); message.SetFrom(fromUser); message.SetGlobalSubject(subject); // HTML 形式 message.AddContent(MimeType.Text, body); var i = 0; foreach (var toUser in toUsers) { var personInfo = new Personalization(); personInfo.Substitutions = new Dictionary <string, string>(); personInfo.Substitutions.Add("%name%", toUser.Name); personInfo.Substitutions.Add("%company%", toUser.Company); message.AddTo(toUser.GetEmailAddress(), i++, personInfo); } var response = await client.SendEmailAsync(message); }
public async Task SendHtmlEmail(string subject, string toEmail, string content) { string apiKey = _configurationService.Email.ApiKey; dynamic sg = new SendGridAPIClient(apiKey); Email from = new Email(_configurationService.Email.From); Email to = new Email(toEmail); Content mailContent = new Content("text/html", content); Mail mail = new Mail(from, subject, to, mailContent); var personalization = new Personalization(); personalization.AddTo(to); if (_configurationService.Email.Bcc != null && _configurationService.Email.Bcc.Any()) { foreach (var bcc in _configurationService.Email.Bcc) { personalization.AddBcc(new Email(bcc)); } mail.AddPersonalization(personalization); } dynamic response = await sg.client.mail.send.post(requestBody : mail.Get()); if (response.StatusCode != System.Net.HttpStatusCode.Accepted) { var responseMsg = response.Body.ReadAsStringAsync().Result; _logger.Error($"Unable to send email: {responseMsg}"); } }
/// ----------------------------------------------------------------------------- /// <summary> /// ModuleAction_Click handles all ModuleAction events raised from the action menu. /// </summary> /// <remarks> /// </remarks> /// ----------------------------------------------------------------------------- private void ModuleAction_Click(object sender, ActionEventArgs e) { try { if (e.Action.CommandArgument == "publish") { // verify security if (this.IsEditable && Personalization.GetUserMode() == PortalSettings.Mode.Edit) { // get content var objHTML = new HtmlTextController(); HtmlTextInfo objContent = objHTML.GetTopHtmlText(this.ModuleId, false, this.WorkflowID); var objWorkflow = new WorkflowStateController(); if (objContent.StateID == objWorkflow.GetFirstWorkflowStateID(this.WorkflowID)) { // publish content objContent.StateID = objWorkflow.GetNextWorkflowStateID(objContent.WorkflowID, objContent.StateID); // save the content objHTML.UpdateHtmlText(objContent, objHTML.GetMaximumVersionHistory(this.PortalId)); // refresh page this.Response.Redirect(this._navigationManager.NavigateURL(), true); } } } } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }
public static void Run( [QueueTrigger("emails", Connection = "AzureWebJobsStorage")] EmailDetails myQueueItem, TraceWriter log, [SendGrid(ApiKey = "SendGridApiKey")] out Mail mail) { log.Info($"C# Queue trigger function processed: {myQueueItem}"); mail = new Mail(); var personalization = new Personalization(); personalization.AddTo(new Email(myQueueItem.Email)); mail.AddPersonalization(personalization); var sb = new StringBuilder(); sb.Append($"Hi {myQueueItem.Name},"); sb.Append($"<p>You're invited to join us on {myQueueItem.EventDateAndTime} at {myQueueItem.Location}.</p>"); sb.Append($"<p>Let us know if you can make it by clicking <a href=\"{myQueueItem.ResponseUrl}\">here</a></p>"); log.Info(sb.ToString()); var messageContent = new Content("text/html", sb.ToString()); mail.AddContent(messageContent); mail.Subject = "Your invitation..."; mail.From = new Email("*****@*****.**"); }
public void SetPersonalization(Personalization personalization) { ItemPersonalization itemPersonalization = personalization.item; if (Data.IsButton()) { Button btn = GetComponent <Button>(); ColorBlock colors = btn.colors; colors.normalColor = personalization.button.buttonColor; btn.colors = colors; itemPersonalization = personalization.button; } Text text = GetComponent <Text>(); if (text == null) { text = GetComponentInChildren <Text>(); } text.font = itemPersonalization.font; text.fontStyle = itemPersonalization.fontStyle; text.fontSize = itemPersonalization.fontSize; text.color = itemPersonalization.textColor; text.alignment = itemPersonalization.alignment; LayoutElement le = this.GetComponent <LayoutElement>(); if (le == null) { le = gameObject.AddComponent <LayoutElement>(); } le.minHeight = personalization.rowHeight; }
public override void Initialize(Personalization personalize) { Debug.Log("Called initialization of item"); GetComponent <RectTransform>().localScale = Vector2.one; //Initialize() TODO:Prebacit Poziv u sami Row; SetPersonalization(personalize); }
// Use NuGet to install SendGrid (Basic C# client lib) private async Task configSendGridasync(IdentityMessage message) { var apiKey = ConfigurationManager.AppSettings["sendGridApiKey"]; dynamic sg = new SendGridAPIClient(apiKey); Mail mail = new Mail(); Content content = new Content(); content.Type = "text/plain"; content.Value = message.Body; mail.AddContent(content); content = new Content(); content.Type = "text/html"; content.Value = message.Body; mail.AddContent(content); mail.From = new Email("*****@*****.**", "ZenZoy"); mail.Subject = message.Subject; Personalization personalization = new Personalization(); var emailTo = new Email(); emailTo.Name = message.Destination; emailTo.Address = message.Destination; personalization.AddTo(emailTo); mail.AddPersonalization(personalization); dynamic response = sg.client.mail.send.post(requestBody: mail.Get()); var status = response.StatusCode; var responseBody = await response.Body.ReadAsStringAsync(); }
Run([ActivityTrigger] RequestApplication request, TraceWriter log) { log.Info("Sending Mail....Please wait"); var ToAddress = Environment.GetEnvironmentVariable("CustomerMail"); string storagePath = Environment.GetEnvironmentVariable("StorageaccountBaseURL") + Environment.GetEnvironmentVariable("inputStorageContainer") + request.name; string FunctionBasePath = Environment.GetEnvironmentVariable("FunctionBasePath"); string mailTemplate = Environment.GetEnvironmentVariable("MailTemplate"); string instanceid = request.InstanceId; Mail message = new Mail(); message = new Mail(); var personalization = new Personalization(); personalization.AddTo(new Email(ToAddress)); message.AddPersonalization(personalization); log.Info(request.LocationUrl + request.name + request.InstanceId); var messageContent = new Content("text/html", string.Format(mailTemplate, storagePath, FunctionBasePath, instanceid)); message.AddContent(messageContent); message.Subject = "Request for Approval"; log.Info("Mail Sent....Please chek with your admin"); return(message); }
public async Task <Response> SendEmailProductAvailableAsync(GetProductEmailDTO dto, List <EmailAddress> emails) //change model product to short and contain url product image { var key = _configuration.GetSection("SendGridService:Key").Value; var client = new SendGridClient(key); var personalize = new Personalization { Substitutions = new Dictionary <string, string> { { ":productName", dto.Name }, { ":productLink", "http://*****:*****@onova.com", "Support Onova"), Subject = "Product available: :productName", TemplateId = "6d13c4d4-5330-42be-8d2e-021978fab05d", Personalizations = new List <Personalization> { personalize } }; return(await client.SendEmailAsync(msg)); }
/// ----------------------------------------------------------------------------- /// <summary> /// DisplayControl determines whether the associated Action control should be /// displayed. /// </summary> /// <returns></returns> /// ----------------------------------------------------------------------------- public bool DisplayControl(DNNNodeCollection objNodes) { if (objNodes != null && objNodes.Count > 0 && Personalization.GetUserMode() != PortalSettings.Mode.View) { DNNNode objRootNode = objNodes[0]; if (objRootNode.HasNodes && objRootNode.DNNNodes.Count == 0) { // if has pending node then display control return(true); } else if (objRootNode.DNNNodes.Count > 0) { // verify that at least one child is not a break foreach (DNNNode childNode in objRootNode.DNNNodes) { if (!childNode.IsBreak) { // Found a child so make Visible return(true); } } } } return(false); }
private Mail Map(MailRequest request) { var mail = new Mail(); var personalization = new Personalization(); if (string.IsNullOrWhiteSpace(_apiKey)) { throw new ArgumentNullException(nameof(_apiKey)); } _sendGridApi = new SendGridAPIClient(_apiKey); foreach (var mailAddress in request.To) { personalization.Tos.Add(new Email(mailAddress.ToString())); } foreach (var bccAddress in request.Bcc) { personalization.Bccs.Add(new Email(bccAddress.ToString())); } foreach (var ccAddress in request.Cc) { personalization.AddCc(new Email(ccAddress.ToString())); } mail.AddPersonalization(personalization); mail.Subject = request.Subject; return(mail); }
protected bool ShowSwitchLanguagesPanel() { if (this.PortalSettings.AllowUserUICulture && this.PortalSettings.ContentLocalizationEnabled) { if (this.CurrentUICulture == null) { object oCulture = Personalization.GetProfile("Usability", "UICulture"); if (oCulture != null) { this.CurrentUICulture = oCulture.ToString(); } else { var l = new Localization(); this.CurrentUICulture = l.CurrentUICulture; } } IEnumerable <ListItem> cultureListItems = Localization.LoadCultureInListItems(CultureDropDownTypes.NativeName, this.CurrentUICulture, string.Empty, false); return(cultureListItems.Count() > 1); } return(false); }
private void SetLanguage(bool update, string currentCulture) { if (update) { Personalization.SetProfile("Usability", "UICulture", currentCulture); } }
public static void MinMaxContentVisibile(Control objButton, int intModuleId, bool blnDefaultMin, MinMaxPersistanceType ePersistanceType, bool value) { if (HttpContext.Current != null) { switch (ePersistanceType) { case MinMaxPersistanceType.Page: ClientAPI.RegisterClientVariable(objButton.Page, objButton.ClientID + ":exp", Convert.ToInt32(value).ToString(), true); break; case MinMaxPersistanceType.Cookie: var objModuleVisible = new HttpCookie("_Module" + intModuleId + "_Visible", value.ToString().ToLowerInvariant()) { Expires = DateTime.MaxValue, Path = (!string.IsNullOrEmpty(Common.Globals.ApplicationPath) ? Common.Globals.ApplicationPath : "/") }; HttpContext.Current.Response.AppendCookie(objModuleVisible); break; case MinMaxPersistanceType.Personalization: Personalization.SetProfile(Globals.GetAttribute(objButton, "userctr"), Globals.GetAttribute(objButton, "userkey"), value.ToString()); break; } } }
private async Task SendConfirmationEmail(string toEmail, string templateId, Personalization <PasswordResetTemplateData> personalized) { //Start SendGridClient var client = new SendGridClient(_sendgridConfigs.Value.API_Key); //Configure email var email = new SendGridEmailTemplate <PasswordResetTemplateData>(templateId); //Add personalization to email! email.AddPersonalization(personalized); //Email from parameters email.from = new From { email = _emailAuthorityConfigs.Value.Email, name = _emailAuthorityConfigs.Value.Name }; var json = JsonConvert.SerializeObject(email, Formatting.None); var response = await client.SendTransactionalEmail(json); if (!response.IsSuccessStatusCode) { if (response.Content != null) { var errorMsg = await response.Content.ReadAsStringAsync(); Log.Error("Failed to send transactional email with password reset for {ToEmail}, with {TemplateId} and {@Email}. Failed with {ResponseMSG}", toEmail, templateId, email, errorMsg); Console.WriteLine(errorMsg); } Log.Error("Failed to send transactional email with password reset for {ToEmail}, with {TemplateId} and {@Template}. Failed with {ResponseMSG}", toEmail, templateId, email, response.ReasonPhrase); } }
public static Mail RequestApproval([ActivityTrigger] ApprovalRequest approvalRequest, TraceWriter log) { // Orchestratorを再開するためのOrchestration ClientのエンドポイントとなるURL var approveURL = ConfigurationManager.AppSettings.Get("APPROVE_URL"); // 承認者のメール。サンプルなので固定にしているが、承認者情報をDBに保存してそれを取得するべき var email = ConfigurationManager.AppSettings.Get("APPROVER_EMAIL"); var message = new Mail { Subject = $"{approvalRequest.CalendarDate.ToString("yyyy/MM/dd")}のスタンプリクエスト" }; Content content = new Content { Type = "text/plain", Value = "承認するにはつぎのURLをクリックしてください。\n\n" + $"{approveURL}&isApproved=true&instanceId={approvalRequest.InstanceId}\n\n\n" + "却下するにはつぎのURLをクリックしてください。\n\n" + $"{approveURL}&isApproved=false&instanceId={approvalRequest.InstanceId}" }; message.AddContent(content); var personalization = new Personalization(); personalization.AddTo(new Email(email)); message.AddPersonalization(personalization); return(message); }
public string RaiseClientAPICallbackEvent(string eventArgument) { var dict = ParsePageCallBackArgs(eventArgument); if (dict.ContainsKey("type")) { if (DNNClientAPI.IsPersonalizationKeyRegistered(dict["namingcontainer"] + ClientAPI.CUSTOM_COLUMN_DELIMITER + dict["key"]) == false) { throw new Exception(string.Format("This personalization key has not been enabled ({0}:{1}). Make sure you enable it with DNNClientAPI.EnableClientPersonalization", dict["namingcontainer"], dict["key"])); } switch ((DNNClientAPI.PageCallBackType)Enum.Parse(typeof(DNNClientAPI.PageCallBackType), dict["type"])) { case DNNClientAPI.PageCallBackType.GetPersonalization: return(Personalization.GetProfile(dict["namingcontainer"], dict["key"]).ToString()); case DNNClientAPI.PageCallBackType.SetPersonalization: Personalization.SetProfile(dict["namingcontainer"], dict["key"], dict["value"]); return(dict["value"]); default: throw new Exception("Unknown Callback Type"); } } return(""); }
public UserSettings GetPersonaBarUserSettings() { var settings = (UserSettings)Personalization.GetProfile(ContainerName, UserSettingsKey); FixUserSettingsDates(settings); return(settings ?? GetDefaultSettings()); }
private Containers.Container LoadNoContainer(ModuleInfo module) { string noContainerSrc = "[G]" + SkinController.RootContainer + "/_default/No Container.ascx"; Containers.Container container = null; // if the module specifies that no container should be used if (module.DisplayTitle == false) { // always display container if the current user is the administrator or the module is being used in an admin case bool displayTitle = ModulePermissionController.CanEditModuleContent(module) || Globals.IsAdminSkin(); // unless the administrator is in view mode if (displayTitle) { displayTitle = Personalization.GetUserMode() != PortalSettings.Mode.View; } if (displayTitle == false) { container = this.LoadContainerByPath(SkinController.FormatSkinSrc(noContainerSrc, this.PortalSettings)); } } return(container); }
/// ---------------------------------------------------------------------------- /// <summary> /// Gets a flag that indicates whether the Module Content should be displayed. /// </summary> /// <returns>A Boolean.</returns> private bool DisplayContent() { // module content visibility options var content = Personalization.GetUserMode() != PortalSettings.Mode.Layout; if (this.Page.Request.QueryString["content"] != null) { switch (this.Page.Request.QueryString["Content"].ToLowerInvariant()) { case "1": case "true": content = true; break; case "0": case "false": content = false; break; } } if (Globals.IsAdminControl()) { content = true; } return(content); }
/// <summary> /// Initializes a new instance of the <see cref="Html5ModuleTokenReplace"/> class. /// </summary> /// <param name="page"></param> /// <param name="html5File"></param> /// <param name="moduleContext"></param> /// <param name="moduleActions"></param> public Html5ModuleTokenReplace(Page page, string html5File, ModuleInstanceContext moduleContext, ModuleActionCollection moduleActions) : base(page) { this.AccessingUser = moduleContext.PortalSettings.UserInfo; this.DebugMessages = Personalization.GetUserMode() != Entities.Portals.PortalSettings.Mode.View; this.ModuleId = moduleContext.ModuleId; this.PortalSettings = moduleContext.PortalSettings; this.PropertySource["moduleaction"] = new ModuleActionsPropertyAccess(moduleContext, moduleActions); this.PropertySource["resx"] = new ModuleLocalizationPropertyAccess(moduleContext, html5File); this.PropertySource["modulecontext"] = new ModuleContextPropertyAccess(moduleContext); this.PropertySource["request"] = new RequestPropertyAccess(page.Request); // DNN-7750 var bizClass = moduleContext.Configuration.DesktopModule.BusinessControllerClass; var businessController = this.GetBusinessController(bizClass); if (businessController != null) { var tokens = businessController.GetTokens(page, moduleContext); foreach (var token in tokens) { this.PropertySource.Add(token.Key, token.Value); } } }
public async Task <IActionResult> Index() { var sendGrid = new SendGridClient(_settings.SendGridKey); var from = "*****@*****.**"; var to = "*****@*****.**"; var subject = "Email subject"; var content = "Email content"; var mail = new SendGridMessage { From = new EmailAddress(from), ReplyTo = new EmailAddress(from), Subject = subject, PlainTextContent = content, Personalizations = new List <Personalization>() }; var personalization = new Personalization { Tos = new List <EmailAddress>() }; personalization.Tos.Add(new EmailAddress(to)); mail.Personalizations.Add(personalization); var response = await sendGrid.SendEmailAsync(mail); var tmp = await response.Body.ReadAsStringAsync(); return(Ok(response)); }
public async Task <SendEmailResponse> SendEmail(HttpClient client, EmailRequest emailRequest) { var request = new HttpRequestMessage(HttpMethod.Post, "https://api.sendgrid.com/v3/mail/send"); //string apiKey = " " + Credentials.SendGridApiKey; var byteArray = new UTF8Encoding().GetBytes(Credentials.SendGridApiKey); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Credentials.SendGridApiKey);//Convert.ToBase64String(byteArray)); //request.Content = new FormUrlEncodedContent(formData); //var serializedFormData = JsonConvert.SerializeObject(formData); var sendGridMessage = new SendGridMessage(); var to = new EmailAddress(emailRequest.To, emailRequest.To_name); var tos = new List <EmailAddress> { to }; var personalization = new Personalization { Tos = tos }; sendGridMessage.Personalizations = new List <Personalization> { personalization }; sendGridMessage.From = new EmailAddress(emailRequest.From, emailRequest.From_name); sendGridMessage.Subject = emailRequest.Subject; var emailContent = new Content("text/html", emailRequest.Body); sendGridMessage.Contents = new List <Content> { emailContent }; var serializedRequest = JsonConvert.SerializeObject(sendGridMessage); //var serializedRequest = "{ \"personalizations\": [ { \"to\": [ { \"email\": \"[email protected]\" } ] } ], \"from\": { \"email\": \"[email protected]\" }, \"subject\": \"Sending with SendGrid is Fun\", \"content\": [ { \"type\": \"text/html\", \"value\": \"and easy to do anywhere, even with <strong>cURL</strong>\" } ]}"; request.Content = new StringContent(serializedRequest, Encoding.UTF8, "application/json"); var result = await client.SendAsync(request); SendEmailResponse response = new SendEmailResponse(); if (result.IsSuccessStatusCode) { response.IsEmailSent = true; response.Message = "Email queued and will be sent shortly"; } else { //log error and return generic error response response.IsEmailSent = true; response.Message = "Oops! Something went wrong. Please try again later."; } return(response); }
public void UpdatePersonaBarUserSettings(UserSettings settings, int userId, int portalId) { var controller = new PersonalizationController(); var personalizationInfo = controller.LoadProfile(userId, portalId); Personalization.SetProfile(personalizationInfo, ContainerName, UserSettingsKey, settings); controller.SaveProfile(personalizationInfo); }
private void ModeChangedInternal(object sender, EventArgs e) { Personalization.SetProfile("LanguageDisplayMode", this._viewTypePersonalizationKey, this._modeRadioButtonList.SelectedValue); // Resort this.BindData(true); this.OnModeChanged(EventArgs.Empty); }