Support » Plugin: MailPoet Newsletters » Add / Remove subscriber via PHP

  • Resolved ceruleus


    Hi there. I would like to know how can I add / remove user to the subscribers list?
    I looked at the examples here and made some function which I call after verifying data of the whole form. I tried to find some reference manual, to see which method is for what and which objects are for what, but without success.
    One more thing – I will need one function for removing the user – but I have no idea how to do that since I don’t know which method is for what (and what methods are existing).

    Here is my function:

    function processMyWysija($idTmp){
    	// $idTmp is id of WP user - it's successfully passed here.
    	$idTmp = intval($idTmp);
    	$userData = get_userdata($idTmp);
    	$modelList = &WYSIJA::get('list','model');
    	$wysijaLists = $modelList->get($dataList);
    	$arrlist = array();
    	foreach($wysijaLists as $list){
    		$arrlist[] = $list['list_id'];
        print_r($userHelper); // here I expected some methods or something, only I got is WYSIJA_help_user Object ( ).

    Any help is appreciated. Thanks in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Sorry, I forgot to say the main thing -_-‘ This function DOESN’T work. There is no any PHP error, or some echoed / printed error. Just, this function doesn’t add an user to a list.

    Well you need to hook that function so that it gets triggered.
    It’s all in that guide :

    The hook is something like that : add_action(‘init’,’processMyForm’);


    Do you know how to remove subscribers without php? I’m using WordPress 3.5.1 don’t believe I’m using a plugin for subscribers. Any ideas?


    Plugin Author MailPoet


    Jack, you’re trying to remove or delete Wysija subscribers?

    You can do that directly in the plugin. Look for the batch actions in the drop down menu.

    Thanks for your reply. It’s not in the wysija plugin, it’s through JetPack Blog Subscriptions. Any ideas?

    Thanks ahead of time!



    Jack, if you were gathering your subscribers through JetPack, then you should ask your question here:

    Hello ceruleus,

    Did you find the way to add subscriber with a hook (and make it working !)?
    I just need to affect a subscriber to a specific list and would like to know what’s the best code for this.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add / Remove subscriber via PHP’ is closed to new replies.