mailchimp php 集成
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9565170/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
mailchimp php integration
提问by Homunculus Reticulli
I am trying to find a simple bare bones example/demo that shows me how I can build a trivial/proof of concept website that will collect user email (and maybe first name), and add this name to a list created on mailchimp.
我试图找到一个简单的基本示例/演示,它向我展示了如何构建一个简单的/概念证明网站,该网站将收集用户电子邮件(可能还有名字),并将此名称添加到在 mailchimp 上创建的列表中。
To clarify, I am not merely asking how to create a PHP/mySQl website - I already know how to do that, and I already know how to place a form on a page etc.
澄清一下,我不仅仅是在问如何创建 PHP/mySQl 网站 - 我已经知道如何做到这一点,而且我已经知道如何在页面上放置表单等。
Assuming I already have the following: - A php/MySQL site with a registration form - A newly created list on mailchimp
假设我已经有了以下内容: - 一个带有注册表单的 php/MySQL 站点 - mailchimp 上新创建的列表
More specifically, I want a user to be able to register on a page on my site, and then I want the following sequence of events to happen:
更具体地说,我希望用户能够在我网站的页面上注册,然后我希望发生以下事件序列:
- When a user clicks the 'submit' button on my page, their details gets sent to mailchimp and added to a specific list created on mailchimp
- They are sent a confirmation email by mailchimp
- Once they confirm subscription, they are directed back to a page on my site, with a token from mailchimp
- I store their details (provided by mailchimp) into my MySQL database
- I send the confirmed subscriber an email with an attachment
- When the user unsubscribes from the list, I get notified by mailchimp and I can flag the user as unsubscribed in my database.
- 当用户单击我页面上的“提交”按钮时,他们的详细信息会发送到 mailchimp 并添加到在 mailchimp 上创建的特定列表中
- 他们会通过 mailchimp 收到一封确认电子邮件
- 一旦他们确认订阅,他们就会被引导回我网站上的一个页面,并带有来自 mailchimp 的令牌
- 我将他们的详细信息(由 mailchimp 提供)存储到我的 MySQL 数据库中
- 我向已确认的订阅者发送一封带有附件的电子邮件
- 当用户从列表中取消订阅时,mailchimp 会通知我,我可以在我的数据库中将用户标记为已取消订阅。
I have not been able to find a simple demo (or tutorial) that shows how to implement the required functionality listed above. Can anyone recommend a link (or links) to get me started with implementing these specific "bare bone" functionality?
我找不到一个简单的演示(或教程)来展示如何实现上面列出的所需功能。谁能推荐一个链接(或多个链接)让我开始实现这些特定的“裸机”功能?
回答by Nanne
The documentation is rather good I thought?
我认为文档相当不错?
Just checkout the API-docs: http://apidocs.mailchimp.com/api/how-to/basic-subscribe.php
只需查看 API 文档:http: //apidocs.mailchimp.com/api/how-to/basic-subscribe.php
And if for some reason you do not want to read docs but just want to see code (please, don't do this, but hey, what do I know): click on the exmples listed here: http://apidocs.mailchimp.com/api/downloads/#examples
如果出于某种原因您不想阅读文档而只想查看代码(请不要这样做,但是嘿,我知道什么):单击此处列出的示例:http://apidocs.mailchimp .com/api/downloads/#examples
Start with the example code and if it doesn't do exactly everything, you can find it at the docs easily enough.
从示例代码开始,如果它不能完全执行所有操作,您可以很容易地在文档中找到它。