Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi, thanks for the prompt response. Here is what I have at the moment for that new function:

    *********************************************
    		contact 7 subscribe to wysiga email list
    *********************************************
    	*/
    
    function wysija_contactform7_subscribe($cfdata) {
    
    	$formdata = $cfdata->posted_data;
    
    	/*
    'your-name' and 'your-email' are from the default template change them to match the ones you use in your form.
    	*/
    
    	$user_name = $formdata['prenom'];
    
    	$user_email = $formdata['email_add'];
    
    	/*
    
    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
    
    	);
    
    	$data=array(
    
    		'user'		=>	$userData,
    
    		'user_list'	=>	array( 'list_ids'=> $listID )
    
    	);
    
    	$userHelper=&WYSIJA::get('user','helper');
    
    	$userHelper->addSubscriber($data);
    
    }
    /*
    Nothing will happen unless you give the user a chance to opt in. Create a radio select on your CF7 form with the options 'yes', 'no'. Name it 'opt-in', or change the variable below to match your form.
    
    	*/
    if(isset($_POST['opt-in']) &&
    $_POST['opt-in'] == 'Oui')
    {
    add_action('wpcf7_mail_sent', 'wysija_contactform7_subscribe', 1);
    }
    ?>

    Being a French website I changed the Yes to Oui, this works if there is an email address, the only issue were it does not work is if there is no email address and No or Non (french for No) is selected. Is there a way that we can tell it if No then continue?

    Thanks
    Mike

    Thanks for the update, sorry for the delay in response, I will give the last name fix a try soon, but first I found an issue that is preventing from submitting if the ‘opt-in’ field is no. If I understand the code properly, there is a condition to the if that if the ‘opt-in’ is “yes” the do the mailsend to add the user to the wysija list, but there is nothing that states what to do if ‘opt-in’ is “no”. Not being a dev I don’t know how to fix this. At this point my contact from does not work if the ‘opt-in’ in field is blank or “no”.

    Thanks in advance

    Got it working with only the following:

    function wysija_contactform7_subscribe($cfdata) {
    
    	$formdata = $cfdata->posted_data;
    
    	/*
    '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
    
    	);
    
    	$data=array(
    
    		'user'		=>	$userData,
    
    		'user_list'	=>	array( 'list_ids'=> $listID )
    
    	);
    
    	$userHelper=&WYSIJA::get('user','helper');
    
    	$userHelper->addSubscriber($data);
    
    }
    /*
    Nothing will happen unless you give the user a chance to opt in. Create a radio select on your CF7 form with the options 'yes', 'no'. Name it 'opt-in', or change the variable below to match your form.
    
    	*/
    if(isset($_POST['opt-in']) &&
    $_POST['opt-in'] == 'yes')
    {
    add_action('wpcf7_mail_sent', 'wysija_contactform7_subscribe', 1);
    }

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    How do I add a users last name?

    I tried the following as it is very interesting and I get the following:
    Fatal error: Cannot redeclare wpcf7_array_flatten() (previously declared in /home/content/40/10295440/html/wp-content/plugins/contact-form-7/includes/functions.php:258) in /home/content/40/10295440/html/wp-content/plugins/contact-form-7/includes/functions.php on line 315

    I’m no dev so not sure how to modify to make it work properly.

    Mike

    Thread Starter Michoumichel

    (@michoumichel)

    Why is this marked as resolved? Problem still persists, although I have found the plugin that is causing the issue.

    The plugin WPNEWCAROUSEL is causing the WP2DB option not to be available. The reason I believe is that both plugins insert themselves after the WP Settings section in the dashboard menu. Regardless of the order the plugins are activated the WPNEWCAROUSEL gets “primary choice”. Maybe the fix would be as simple as having the WP2DB plugin display it’s settings after the separator as other plugins do.

    Please keep me informed

    Thread Starter Michoumichel

    (@michoumichel)

    FYI, I just installed the latest version of the plugin and that has not made any difference.

    Thread Starter Michoumichel

    (@michoumichel)

    I have the Administrator role, and have not had issues with any other plugins. The plugin is stated as “Activated” in the Installed plugin page. Could it be a conflict with another plugin?

    Thread Starter Michoumichel

    (@michoumichel)

    Hi sorry for the confusion, under settings, there are no sub pages for “Backup” therefore I can’t get the initial prompt to authorize the app fro dropbox. Hope this is description is clearer ??

Viewing 8 replies - 1 through 8 (of 8 total)