You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
You also need to tell Skybrud.Umbraco.MailChimp what properties your submit form will send. Please remember to enherit fromMailChimpSignup as shown below.
You also need to create a controller to handle your api-call from the frontend. Here you can find an example:
usingSystem;usingSystem.Net;usingSystem.Net.Http;usingSystem.Web;usingSystem.Web.Http;usingMailChimp.Helper;usingServiceStack.Text;usingSkybrud.Umbraco.MailChimp.Models;usingUmbraco.Core.Logging;usingUmbraco.Web.WebApi;usingCustomer.Models.Website.MailChimp;namespaceCustomer.Controllers.Api.MailChimp{publicclassMailChimpSignupController:UmbracoApiController{[HttpPost]publicobjectSaveUpdate(HttpRequestMessagerequest){try{// cast your custom mailchimp form modelCustomMailChimpFormModelmco=CustomMailChimpFormModel.GetModel(request);// add your config model to the MailChimpFormModelvarconfig=newMailChimpOptions(true,"html",newCustomMailChimpMergeModel{NAME=mco.Name});mco.AddConfig(config);EmailParameterr=mco.SaveUpdateSubscriber(mco);returnRequest.CreateResponse(r);}catch(Exceptionex){LogHelper.Error<MailChimpSignupController>("mailchimp error",ex);returnRequest.CreateErrorResponse(HttpStatusCode.InternalServerError,ex.Message);}}}}
Now you can post to this api, and Skybrud.Umbraco.MailChimp will save or update your subscriber.
Umbraco Properties
skyMailChimpApiKey - API key from MailChimp (overwrites appsettingmailchimpapi in web.config)
skyMailChimpUpdateFromEmail - Overwrites default from-mailaddress for update profile e-mail
skyMailChimpUpdateFromDisplayName - Overwrites default displayname for update profile e-mail
skyMailChimpUpdateMailSubject - Overwrites default subject for update profile e-mail
skyMailChimpUpdateMailBody - Overwrites default body for update profile e-mail ({updateLink})
MailChimp template
If you want your subscribers to be able to ex. update their groups or name, you can add an update link in your MailChimp template.
<a href="https://customerdomain.com/news/newslettersignup/?email=*|EMAIL|*&id=*|EMAIL_UID|*" mc:edit="std_update">Update your profile</a>
Remember to change domain + url, but leave the querystring.
Updates
0.5.3
Security added. You know need to have emailId from MailChimp to edit/update existing subscriber
Now you can send the subscriber a update-link
0.5.6
Added option for overwrite default from e-mail and display name (update mail)
About
Small package to help your customers subscribe/update their MailChimp subscriptions.