Am trying to using Services Mailman php api to add emails to a mailing list created at the backend with the site cpanel but no email is being added.
Here is my code
require './Services/Mailman.php';
$mm = new Services_Mailman( 'http://example.com/mailman/admin/', 'newsletter', NEWSLETTER_PASS );
try {
// $mailinglists = $mm->lists();
// foreach ( $mailinglists as $list ) {
// echo $list['name'] . "\n";
// }
var_dump( $mm->subscribe('[email protected]') );
} catch ( Services_Mailman_Exception $e ) {
die( 'Error: ' . $e->getMessage() );
}
Here is a screenshot of my var_dump
I don't what the problem could be, is it the admin url that i am using or is it something else because everything from the mailing list password and list name provided are correct. Please help. Thank you.
I figured out a solution by looking at their comments for the subscribe method below in which i noticed i had input the mailing list the wrong way by just naming it instead adding the other details i.e
newsletter_example.com
and no it's not[email protected]
for some reason.You can look at the comments for the subscribe method to figure it out.