• Resolved kveelenturf

    (@kveelenturf)


    Hi,

    I’m using your plugin and it seems to work for brand new subscribers. However, when a subscriber who is known to the system, will not be added to a new list. That was working in the version for MailPoet 2. Is that something that could be resolved?

    Cheers.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter kveelenturf

    (@kveelenturf)

    I’ve tried to fix the problem myself, using inspiration from another thread (https://ww.wp.xz.cn/support/topic/modification-to-allow-adding-to-lists/).

    I’ve replaced the code around line 109 with the following, I tested it and it worked.

    		try {
    			$subscriberExists = \MailPoet\API\API::MP('v1')->getSubscriber($subscriber_data['email']);
    		} catch(Exception $exception) {
    			if ( $subscriberExists == '' ) {
    				try {
    					$subscriber = \MailPoet\API\API::MP('v1')->addSubscriber($subscriber_data, $mailpoetlists);
    				} catch (Exception $exception) {
    					// return $exception->getMessage();
    				}
    			}
    		}
    
    		if ($subscriberExists != '' ) {
    			try {
    				$subscriber = \MailPoet\API\API::MP('v1')->subscribeToLists($subscriber_data['email'], $mailpoetlists);
    			} catch (Exception $exception) {
    				// return $exception->getMessage();
    			}				
    		}

    Hi @kveelenturf,

    There is no word to thank you for your help. A new version has been released. Please let me know if you have any problem.

    Thanks

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

The topic ‘Subscribing to extra list’ is closed to new replies.