WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
use #_CONTACTEMAIL as Notification sender address? (8 posts)

  1. halifaxious
    Member
    Posted 2 years ago #

    When a user books, she receives a confirmation email. If the Events Manager email settings 'Notification sender address' is not set, that email comes from apache@myserver.com which means that it usually gets flagged as spam.

    But if 'Notification sender address' is set to a generic email like 'events@mysite.com', then users mistakenly correspond with that address rather than the Contact Email for the particular event.

    Is there a way to make Events Manager use the #_CONTACTEMAIL shortcode as the Notification sender address?

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 2 years ago #

    Am going to test this and update you again.

  3. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    not without you hooking into EM/WP with some PHP (not entirely sure we have a hook for this, if you need one specifically somewhere let us know)

  4. halifaxious
    Member
    Posted 2 years ago #

    I'm fine with writing a bit of code to make this happen.

    What I envision is that I put the #_CONTACTEMAIL placeholder in the 'Notification sender address' field and perhaps the #_CONTACTNAME placeholder in the 'Notification sender name' field in EM->Settings->Emails->Email Settings.

    Then, whenever EM needs to send an email, the Email Settings would be filtered and subbed according to the context of the email. I would probably also add a filter to sub in the website default email if 'Notification sender address' were blank.

    Is there an existing hook I could attach to for the above?

  5. agelonwl
    Member
    Posted 2 years ago #

    These functions might give you an idea:

    EM Classes:
    1. em-booking.php - function email()
    2. em-mailer.php
    3. em-object.php - email_send()

  6. manakuke
    Member
    Posted 2 years ago #

    Quick and dirty, you could manually edit em-mailer.php on lines 48, 49

    $mail->From = get_option('dbem_mail_sender_address');
    			$mail->FromName = get_option('dbem_mail_sender_name');

    and replace with your content. Would be nice if this come from the EM settings, otherwise I'm assuming this file would become overwritten when the plugin is updated.

    I'm playing around with writing a companion plugin to address this, but I am far from being an expert in this area.

  7. manakuke
    Member
    Posted 2 years ago #

    Looks like for me, I'm using Multisite, so be default, I cannot see the Email Settings options. I switched the code to allow this on my installation, but will this create conflicts on other blogs on my network? Or is there a way to better enable these options in Multisite?

    I do like halifaxious' idea above.

  8. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    You need to look more specifically to the EM_MS_Globals class in the events-manager.php file. You can pretty much control whatever options you want to make local to blogs by manipulating those hooks we work with.

    The idea is that you have a noreply sort of email, and you can use the event contact email in the email body. Otherwise, you'd just make the email a contactable email if you're e.g. a small company.

    willing to add this, but it's in a long line...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic