Sending mail using a hook from another plugin
-
Hi
I am currently developing a site and am using Mailpoet to send out newsletters and notification of new posts on the site. I would like to be able to hook into the Mailpoet sending routine from my Events plugin (Events Made Easy), so that I can send notification of new events using the same distribution list.
Events Made Easy has a hook for new event notifications, using the code below:
add_action('eme_insert_event_action','eme_mail_event'); function eme_mail_event ($event) { $contact = eme_get_event_contact ($event); $contact_email = $contact->user_email; $contact_name = $contact->display_name; $subject_format="This is the new event called ' #_EVENTNAME '"; $body_format="This is the new event called ' #_EVENTNAME '"; $subject=eme_replace_placeholders($subject_format, $event, "text"); $body=eme_replace_placeholders($body_format, $event, "text"); $blogusers = get_users(); foreach ( $blogusers as $user ) { eme_send_mail($subject,$body, $user->user_email, $user->display_name, $contact_email, $contact_name); } }
Does Mailpoet have a command equivalent to the ’eme_send_mail’ function, which I can call from this hook to send mail to a specific distribution list?
If I can’t do this it means that users will have to sign up to two separate distribution lists, which is not great.
Apologies if this is answered elsewhere, I can’t find anything relevant.
Thanks in advance for any help.
Ian
- The topic ‘Sending mail using a hook from another plugin’ is closed to new replies.