Quantcast
Channel: WordPress.org Forums » [Contact Form 7] Support
Viewing all articles
Browse latest Browse all 49500

permaculturetreegeek on "[Plugin: Contact Form 7] Contact form 7 subscribe to wysiga newsletter on submit"

$
0
0

Cool, simpler solution.

I haven't tested this, but you should be able to add another string for last name, as long as it matches the one in the wisija database.

SO, instead of this:

/*
'your-name' and 'your-email' are from the default template change them to match the ones you use in your form.
	*/

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

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

	/*

Insert the list id # you want the user to be subscribed to. The default list id is 1. This can be an array if you have more than one list. Example: $listID = array( '1,2' );
	*/

	$listID = array( '1' );	

	$userData=array(

		'email'		=>	$user_email,

		'firstname'	=>	$user_name

	);

Add the last name string:

/*
'your-name', 'your-email', 'your-lastname' << change the identifier to match the ones you use in your cf7 form. This section gets the data from your form and stores it an a string.
	*/

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

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

        $user_lastname = $formdata['your-lastname'];

	/*
Insert the list id # you want the user to be subscribed to. The default list id is 1. This can be an array if you have more than one list. [Example: $listID = array( '1,2' );]
	*/

	$listID = array( '1' );	

/* The $userData=array forms the $string data from cf7 by connecting it to the appropriate wysija database table.
	*/

	$userData=array(

		'email'		=>	$user_email,

		'firstname'	=>	$user_name,

                 'lastname'	=>	$user_lastname

	);

Viewing all articles
Browse latest Browse all 49500

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>