• Resolved cihomewood

    (@cihomewood)


    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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi there @cihomewood,

    Thanks for reaching out!

    Can you please let me know what you’re trying to achieve in the first place?

    Do users sign-up using a MailPoet form but you’d like them to also receive emails from the Events plugin using MailPoet Sending Service?

    Thread Starter cihomewood

    (@cihomewood)

    Hi

    Yes, subscribers sign up using a Mailpoet form and are added to a ‘Daily Digest’ list. This is linked to a daily email of new posts.

    I would like to either include Events Made Easy events in this email, or be able to create another notification in Mailpoet for the EME events. The key is that I don’t want users to have to sign up separately for the new events notification.

    The web address is https://s870750007.websitehome.co.uk/.

    Thanks

    Ian

    Hi there @cihomewood,

    Got it!

    So you should be able to choose your custom post type in the Automatic Latest Content widget. Note that we only support custom post types that are searchable on the front-end.

    Can you please check if that works for you?

    Thread Starter cihomewood

    (@cihomewood)

    Thanks Elvira. Nothing from EME shows up in the selection box on that widget, which is why I thought I may be able to solve it from the other end.

    If I can call the Mailpoet send function from within the EME hook that should give me what I need (I hope).

    Ian

    • This reply was modified 3 years, 7 months ago by cihomewood.

    Hi there @cihomewood,

    I checked with our developers and I’m afraid it’s not possible.

    Please do let us know if you have further questions!

    Cheers!

    Thread Starter cihomewood

    (@cihomewood)

    Thanks Elvira

    Ian

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Sending mail using a hook from another plugin’ is closed to new replies.