[Events +] Where to customize the text of the "Information about a group event" email?

Upon creation or update of a group event the group members receive an email with subject "Information about a group event".

The standard contents are: "Dear USER_NAME, ,

An event is created/updated. I hope you will join in that event. Check the event here: EVENT_LINK"

I can't figure out how to customize this email message.
Hope you can help me.

  • Ash
    • WordPress Hacker

    Hello mpress

    To change the subject, try the following code:

    add_filter( 'eab_bp_grp_events_member_mail_subject', function( $subject ) {
    	return 'Your custom subject.';
    } );

    To change the email content, try the following code:

    add_filter( 'eab_bp_grp_events_member_mail_message', function( $message, $member, $post_id ) {
    	return 'Your custom message!';
    }, 99, 3 );

    Here, $member is the WP_User object and $post_id is the event ID. You can find the code in /wp-content/plugins/events-and-bookings/lib/plugins/eab-buddypress-group_events.php line no 270.

    You can use this code in your child theme's functions.php if the theme is not changed. Otherwise mu-plugin is the best option. To create a mu-plugin, go to wp-content/mu-plugins folder. If there is no mu-plugins folder then, create one. Now, inside the mu-plugins folder create file with name anything.php (make sure file extension is .php). Now start with a <?php tag and then put the above code.

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!

    Cheers,
    Ash

  • mpress
    • Code Wrangler

    Hi Ash,

    That's really a pity. The RSVP related emails are all nicely set customizable in the Addons. So I was hoping that also this basic email was somewhere alike. Unfortunately not.

    I have translated it in the php file as you suggested.
    How to make the < br >< br > codes effective? Currently they are treated as text.

    Thanks for your help.

    $message = __( 'Dear ' . $member->display_name . ',< br >< br >An event is created/updated. I hope you will join in that event. Check the event here: ' . get_permalink( $post_id ), Eab_EventsHub::TEXT_DOMAIN );

  • Nithin
    • Support Wizard

    Hi mpress,

    The HTML would be treated as texts in the above function, maybe you could test with sprintf function, for example:
    $message = sprintf( 'Dear %s ,<br><br>An event is created/updated. I hope you will join in that event. Check the event here: %s', $member->display_name, get_permalink( $post_id ));

    If the above doesn't work, please share the full code you are testing, so that we could have a better idea. Have a nice day ahead. :slight_smile:

    Regards,
    Nithin

  • Nithin
    • Support Wizard

    Hi mpress,

    I'm afraid, support access still looks disabled, and I'm not sure what exact should be checked via support access, if it's about the above code changes.

    You can either attach the code as a txt file in your next reply, or share it via 3rd party sites like Google Drive, Dropbox etc

    Looking forward to your response, have a nice day ahead. :slight_smile:

    Regards,
    Nithin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.