
Originally Posted by
carlwhat
from the latest code:
PHP Code:
function mailchimp_add($email) {
$mailchimp = new MailChimp(BOX_MAILCHIMP_NEWSLETTER_API_KEY);
$reply = $mailchimp->list_add_subscriber([
'id_list' => BOX_MAILCHIMP_NEWSLETTER_ID,
'email' => $email,
'status' => 'pending'
]);
not sure how that removes the double opt-in, as still in a pending status v subscribed status.
ok, dig in... and you find this:
PHP Code:
public function list_add_subscriber(Array $options)
{
// Check required params
if ( ! isset($options['id_list']) OR ! isset($options['email']))
{
throw new MailChimpException('Parameters not set on '.__METHOD__);
}
$endpoint = '/lists/' . $options['id_list'] . '/members/';
$payload = [
'email_address' => $options['email'],
'status' => 'subscribed',
// 'status' => isset($options['status']) ? $options['status'] : 'pending',
];
so the double opt-in is removed. not really sure why it would be done here as opposed to the original call to mailchimp_add.
Bookmarks