How to send email to mailing list from custom plugin
-
Hello.
I am administrating a wordpress with mailpress and wpadverts.
I want to send an email to all recepients in adverts_subscribers mailing list (from mailpress) when someone post an add (with the plugin wpadverts).
My idea was:
#1 bind to a hook in wpadverts fired when an ad is posted
#2 generate the email content to be notified
#3 in the callback, use mailpress to get the mailing list, and send the email with itDo you think this is reasonable ? I tried and I am stuck with #3
See my current code:
function hello_dolly() { $list = MP_Mailinglist::get_all(); printf($list); return; } // Now we set that function up to execute when the admin_notices action is called. add_action( 'admin_notices', 'hello_dolly' );
This fails, with this error:
Fatal error: Class 'MailPress_mailinglist' not found in /var/www/html/wp-content/plugins/mailpress/mp-includes/class/MP_Mailinglist.class.php on line 105
Do you have any tips on how I should proceed ?
I am very new to WordPress, and didn’t do any PHP development in a decade, so please bear with me.Cheers,
Rodolphe
- The topic ‘How to send email to mailing list from custom plugin’ is closed to new replies.