通过MailChimp发送电子邮件 [英] Send an email via MailChimp

查看:1625
本文介绍了通过MailChimp发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为问题是围绕 $ API - > listSubscribers()

include('../libs/mailchimp/MCAPI.class.php');

$options = array('list_id' => '$list_id', 'subject' => 'Prova', 'from_name' => 'name', 'from_email' => 'info@example.com');
$content = array('html' => '<p>Testo di prova</p>');

$api = new MCAPI($apikey);
$campaignId = $api->campaignCreate('trans', $options, $content);

$api->listSubscribe($options['list_id']);

$api->campaignSendNow($campaignId);

if ($api->errorCode){
    echo "Unable to Create New Campaign!";
    echo "\n\tCode=".$api->errorCode;
    echo "\n\tMsg=".$api->errorMessage."\n";
} else {
    echo "New Campaign ID:".$campaignId ."\n";
}

为什么一点儿也不它发送电子邮件?

Why does'nt it send an email?

推荐答案

您有几个问题在这里:

第一个是,你是不是做错误每个API调用后检查。如果你把错误从底部检查code和listSubscribe()调用后,坚持下去,你会因为你没有经过任何形式的用户数据(至少是立即收到一条错误您需要的电子邮件地址)。对于listSubscribe的文档是这里

The first one is that you are not doing error checking after each API call. If you take the error checking code from the bottom and stick it after the listSubscribe() call, you'll immediately get an error because you aren't passing any sort of subscriber data (at the very least you need the email address). The docs for listSubscribe are here

一旦你这样做 - 除非你已经详细阅读并认为在listSubscribe文档的选项 - 你的第二个问题将是正在运行设置为true(默认值)double_optin参数listSubscribe,这意味着他们不会被认购,直到单击确认电子邮件中的链接。

Once you do that - unless you've thoroughly read and considered the options in the listSubscribe docs - your second issue is going to be that you are running listSubscribe with the double_optin parameter set to true (the default), which means they won't be subscribed until clicking a link in the confirmation email.

接下来,code只是要给你带来麻烦,而且可能很快。如果你要使用伪transcational活动是imperrative,你只能创建每种类型的电子邮件的一个伪反式竞选活动,然后一遍又一遍地发送活动。这就是他们打算如何工作。不这样做,将会使你的帐户填了一大堆垃圾运动,此时有一个在因为这是相同的创建/在单个用户发送定期的活动,并使用伪反运动是没有意义的结束了。

Next, that code is just going to get you in trouble, and probably quickly. If you are going to use psuedo-transcational campaigns it is imperrative that you only create ONE psuedo-trans campaign per type of email and then send that campaign over and over. That's how they are intended to work. Not doing that is going to cause you to fill up your account with a whole bunch of trash campaigns at which point there's no point in using a psuedo-trans campaign since that's the same as creating/sending a regular campaign to a single user over and over.

这篇关于通过MailChimp发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆