I have integrated Hype mailchimp with Symfony2, When a user subscribes to my website, he/she gets a confirmation mail from mailchimp which asks if they want to subscribe to a particular list or not.
Is there a setting in mailchimp or a switch/config setting in the bundle from which I could switch off this confirmation mail and my users could directly be added to the list.
Thanks in advance!
Inside the Mailchimp Class find a function given below and change the $double_optin=true
to $double_optin=false
function listSubscribe($id, $email_address, $merge_vars=NULL, $email_type='html',
$double_optin=true, $update_existing=false, $replace_interests=true,
$send_welcome=false) {
You have to use the Mailchimp API if you want to subscribe users to a list without a confirmation email.
If you look at the documentation for list subscribe, you can set the double_optin
value to false
, and your users won't get a confirmation email.
edit:
You could try this code.
$merge_vars = array('mc_notes'=> array('test notes'));
$result = $mailchimp->lists->subscribe($listid,
array('email'=>"email@example.com"),
$merge_vars,
false,
true,
false,
false
);