donglao4370 2016-02-19 02:10
浏览 75
已采纳

Mailchimp首先验证用户电子邮件

I use Laravel 5 to develop an app and I use Mailchimp for adding subscription. I use Mailchimp v.3 . I can make a list using this code:

               $mailchimp = new Mailchimp(xxxxxxxxxxxx-xx);
               $contact = [
                    'company' => $request['campaign'],
                    'address1' => $request['address'],
                    'city' => $request['city'],
                    'state' => $candidate->userCandidate->state,
                    'zip' => $request['zip'],
                    'country' => $request['country'],
                    'phone' => $request['phone'],
                ];

                $campaign_details = [
                    'from_name' => $request['from_name'],
                    'from_email' => $request['from_email'],
                    'subject' => $request['remind_text'],
                    'language' => 'English'
                ];

                $data = [
                    'name' => Auth::user()->name . ' Campaign',
                    'contact' => $contact,
                    'permission_reminder' => $request['remind_text'],
                    'campaign_defaults' => $campaign_details,
                    'notify_on_subscribe' => $request['from_email'],
                    'notify_on_unsubscribe' => $request['from_email'],
                    'email_type_option' => false,
                    'visibility' => $request['visibility'],

                ];

                $list = $mailchimp->post('lists', $data);

I use this library drewm/mailchimp. My code on subscribing is this:

$mailchimp = new Mailchimp($api_key);
  $subscriber = [
    'email_type' => 'html',
    'email_address' => $email,
    'language' => 'English',
    'status' => 'subscribed',
    'merge_fields' => ['zip' => $zip]
  ];

  $result = $mailchimp->post('lists/' . $list_id . '/members', $subscriber);

And I can successfully subscribe it. This is my question how to verify an email first before will be recorded on mailchimp list to avoid spammer. I read on mailchimp that they have DOUBLE OPT-IN method but it is only available if you use their form.

My solution is to email first on subscriber and create a link for verifying and this solution can take time. Is there another solution on this? Does Mailchimp have method to acquire this?

  • 写回答

3条回答 默认 最新

  • dsj8000 2016-02-19 03:05
    关注

    I don't have any idea on Mailchimp API. However, you just have to set up an email validation flow first. In this way, all emails will not be considered as "spam" in your records. Then you're free to do any email tasks without worrying if it is valid or not.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题