Support

Home Forums Event Espresso Premium Active message of an event Reply To: Active message of an event

Reply To: Active message of an event

Author Replies
Tony # Posted on May 17, 2018 at 3:08 am

Hi there,

If all you want to do is check if there’s a custom template set on the event then you don’t need the GRP_ID.

You can do something like this:

$event_id = $post->ID;
$messenger = 'email';
$message_type = 'registration';

$custom_message_count = EEM_Message_Template_Group::instance()->count(
    array(
        array(
            'MTP_messenger' => $messenger,
            'MTP_message_type' => $message_type,
            'Event.EVT_ID' => $event_id,
            'MTP_is_global' => false,
            'MTP_is_active' => true
        )
    )
);

if($custom_message_count) {
    //You have a custom template set, do whatever here.
}

That will return a count of the custom message templates set on the ‘Registration Approved’ message type, so if it’s greater than 0 you have a custom template, otherwise its global.

Do NOT follow this link or you will be banned from the site!