Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable double opt-in? #30

Open
simplenotezy opened this issue Nov 19, 2014 · 4 comments
Open

How to disable double opt-in? #30

simplenotezy opened this issue Nov 19, 2014 · 4 comments

Comments

@simplenotezy
Copy link

I have tried this:

  MailchimpWrapper::lists()->subscribe('some_id', array('email'=>'[email protected]'), array('double_optin'      => false));
@mbsmi
Copy link

mbsmi commented Nov 22, 2014

I am needing to find out the same for disabling double opt in and to update an existing email address.

The code that I have attempted to use is:

MailchimpWrapper::lists()->subscribe('list_id', array('email' => Input::get('email'), array('FNAME' => Input::get('first_name'), 'LNAME' => Input::get('last_name')), 'double_optin' => false, 'update_existing' => true));

@bartmoons
Copy link

This works for me:

MailchimpWrapper::lists()->subscribe($list_id, array('email' => $input['email']), null, null, false, true);

null is first name and last name

@hoshomoh
Copy link

Thanks @bartmoons will try this out and see if it will also work for me.

@zeckdude
Copy link

I was looking for a solution where I can write the option names as keys for a multidimensional array like so:

MailchimpWrapper::lists()
    ->subscribe($list_id,
      array(
        'email' => $email_address,
      ),
      array(
        'merge_vars' => array('FNAME' => $first_name, 'LNAME' => $last_name),
        'double_optin' => false,
        'update_existing' => true,
        'replace_interests' => false,
        'send_welcome' => false
      )
);

But unfortunately I couldn't figure out the syntax for that (if it is even possible), so thanks for @bartmoons' suggestion, I was able to get it work like so:

MailchimpWrapper::lists()
    ->subscribe($list_id,
      array(
        'email' => $email_address,
      ),
      array('FNAME' => $first_name, 'LNAME' => $last_name),
      "html", // email type
      false, // double optin
      true, // update existing
      false, // replace interests
      false //send welcome
);

Using this approach you will need to add each parameter, at least until the one you want to specify, even though they're actually optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants