• Resolved LabiosDeCenizas

    (@labiosdecenizas)


    Ok, i’m using the documented function
    $Knews_plugin->add_user(‘[email protected]’, 1, ‘en’, ‘en_US’);

    I’m trying to add new register users via Buddypress form to my newsletter list.

    But the function don’t respond to add_action, do_action calls.

    One example, used in my functions.php for test purpose:

    add_action (‘callknews’, ‘$Knews_plugin->add_user’, 10, 4);
    do_action (‘callknews’, ‘[email protected]’, 1, ‘en’, ‘en_US’);

    Doesnt’ work… How can i send parameters to $Knews_plugin->add_user() function via a do_action?

    https://www.ads-software.com/extend/plugins/knews/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter LabiosDeCenizas

    (@labiosdecenizas)

    Ok, i found the right way to use an add_action:

    add_action(‘callknews’, array($Knews_plugin,’add_user’));

    With this code in functions.php will be easy to integrate in all type of forms with a do_action calling.

    Plugin Author creverter

    (@creverter)

    Ok, thanks… ??

    Carles.

    Hi everybody, i need a help!
    i tryed different way and the trick in that post have help me to join a half solution. (great half thanks! ??
    in few words I have put in functions.php

    add_action('callknews', array($Knews_plugin,'add_user'));
    
    function my_conversion( $cf7 )
    {
    	$email = $cf7->posted_data["email"];
    	do_action ('callknews', $email, 1, 'it', 'it_IT');
    	return TRUE;
    }
    
    add_action( 'wpcf7_before_send_mail', 'my_conversion' );

    rest 2 problems:
    1.CF7 not reply “message sent” but message will be sent
    2.the user will be added without any ML subscription, language is “en” and not “it” (ignore the lang and ML parameters)

    Great big (entire) thanks for any reply

    WOW!! I made it!!
    For anyone with same problem I post the solution:
    in “functions.php” file

    add_action('callknews', array($Knews_plugin,'add_user'),10,6);
    
    function my_conversion( $cf7 )
    {
    	$email = $cf7->posted_data["email"];
    	$nome = $cf7->posted_data["nome"];
    	do_action ('callknews', $email, 7, 'it', 'it_IT',array('1'=>$nome,'2'=>$nome),TRUE);
    	return TRUE;
    }
    
    add_action( 'wpcf7_before_send_mail', 'my_conversion' );

    i’m happy! ??
    Sangio

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Help adding subscription in register form.’ is closed to new replies.