Hi Prajakta,
Are you talking about welcome email or confirmation email? In both cases, please make sure that your sending method is configured along with the from/reply-to email address under Settings (try sending a test email to make sure). We’ve just tried using the following code:
$subscriber_data = array(
'email' => 'john.doe@example.com',
'first_name' => 'John',
'last_name' => 'Doe'
);
$options = array(
'send_confirmation_email' => true,
'schedule_welcome_email' => true
);
$lists = array(2); // "my first list" that's created by the plugin by default
$subscriber = \MailPoet\API\API::MP('v1')->addSubscriber($subscriber_data, $lists, $options);
…and received the confirmation email: https://i.imgur.com/iDxypLq.png
Cheers,
MailPoet Team.
Thanks for your reply.
We did exactly same as you described. It’s not working.
Here is code we used – https://goo.gl/hgBX65
$lists = array( $list_id );//list should be in array format;
$is_double_optin = false;
if($d_optin == ‘1’){
$is_double_optin = true;
}
$options = array(
‘send_confirmation_email’ => $is_double_optin, // default: true
‘schedule_welcome_email’ => $is_double_optin ,// default: true
);
$subscriber_id = \MailPoet\API\API::MP(‘v1’)->addSubscriber( $subscriber_data, $lists, $options );
Still, we are not able to receive the confirmation email. Contact get added to list directly as the unconfirmed subscriber.
Any solution for this?