Ask your WordPress questions! Pay money and get answers fast! (more info)

Contact Form 7 and Wysija (Mailpoet) WordPress

  • SOLVED

I had that integration working, and it stopped. I need the code again to make it work.

http://wpquestions.com/question/show/id/8262

BTW, since it was not working, I made the Contact Form 7 update, so I'd have to reintegrate the code.

PPL r having the same issue:
http://wordpress.org/support/topic/contact-form-7-now-incompatible-with-mailpoet-formerly-wysija-1

Answers (1)

2013-11-07

Balanean Corneliu answers:

This code is not working enymore? You have tested after update?

function wysija_contactform7_subscribe($cfdata) {

$formdata = $cfdata->posted_data;



/*

if you use different name/id attribute for CF7

please change 'your-name' and 'your-email'

*/

$user_name = $formdata['your-name'];

$user_email = $formdata['your-email'];



/*

change this according to your user list id you want this user to subscribe,

*/

$listID = array( 'my_list_ID_1', 'my_list_ID_2' );



$userData=array(

'email' => $user_email,

'firstname' => $user_name

);

$data=array(

'user' => $userData,

'user_list' => array( 'list_ids'=> $listID )

);

$userHelper=&WYSIJA::get('user','helper');

$userHelper->addSubscriber($data);

}

add_action('wpcf7_mail_sent', 'wysija_contactform7_subscribe', 1);