Change MailChimp's success/error message

一笑奈何 提交于 2020-05-27 03:54:26

问题


I can't find this anywhere. Can anyone who's familiar with MailChimp advise?

I've embed my form/input and there's some empty div's (below) which have error/success messages injected.

<div id="mce-responses" class="clear">
    <div class="response" id="mce-error-response" style="display:none"></div>
    <div class="response" id="mce-success-response" style="display:none"></div>
</div>

When I add custom text to the empty div's it just gets overwritten when the form is submitted so it's obviously getting the content from MailChimp somehow/where!

Any ideas?


回答1:


A programatic way to do it is with some javascript:

// select the target node
var target = document.getElementById('mce-success-response');

// create an observer instance
var observer = new MutationObserver(function(mutations) {
  mutations.forEach(function(mutation) {
    if (target.innerHTML === "Thank you for subscribing!") {
      target.innerHTML = "Check your email!";
    }
  });
});

// configuration of the observer:
var config = { attributes: true, childList: true, characterData: true };

// pass in the target node, as well as the observer options
observer.observe(target, config);

Got that code from here.




回答2:


Found this resource:
https://kb.mailchimp.com/lists/signup-forms/translate-the-mailchimp-embed-code

The Classic Form for mailchimp generates the success and error messages statically, so this has something to do with the language settings.

I've done it my self for a form by following these steps:

  1. Go to the list you are using and press "Signup forms", such that the window looks like this. Then open the "Form builder"

  1. When the "Form builder" is open. #1 Change the "Forms and response emails" to "Confirmation thank you page". #2 Change the tab to "Translate it". #3 Change the "Set default language" to Custom.

  1. Now it should be possible to change the "Thank you for subscribing!" text, while to change the error messages just change the "Forms and response emails" selection.



来源:https://stackoverflow.com/questions/47798027/change-mailchimps-success-error-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!