更改MailChimp的成功/错误消息

use*_*440 4 html forms mailchimp mailchimp-api-v3.0

我在任何地方都找不到。熟悉MailChimp的任何人都可以提出建议吗?

我已经嵌入了表单/输入,并且有一些空的div(下),其中插入了错误/成功消息。

<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>
Run Code Online (Sandbox Code Playgroud)

当我将自定义文本添加到空div时,提交表单时它就会被覆盖,因此很显然,它是从某种方式/位置从MailChimp获取内容的!

有任何想法吗?

jar*_*lff 11

一种编程方式是使用一些 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);
Run Code Online (Sandbox Code Playgroud)

这里得到那个代码。

  • 虽然这有效,但来自 Mailchimp 的消息可能会在任何给定时间发生变化,从而破坏您的应用程序。 (2认同)

Tux*_*xca 5

找到此资源:https :
//kb.mailchimp.com/lists/signup-forms/translate-the-mailchimp-embed-code

mailchimp的经典表单会静态生成成功和错误消息,因此这与语言设置有关。

我已经按照以下步骤完成了自己的表单工作:

  1. 转到您使用的列表,然后按“注册表单”,以使窗口如下所示。然后打开“表单构建器”

  1. 打开“表单构建器”时。#1将“表格和回复电子邮件”更改为“确认谢谢页面”。#2将选项卡更改为“翻译”。#3将“设置默认语言”更改为“自定义”。

  1. 现在应该可以更改“谢谢您的订阅!” 文本,而要更改错误消息,只需更改“表单和回复电子邮件”选择。

  • 我需要 10 分才能将图像添加到我的答案中,所以我只是将它们链接起来。 (2认同)