Support

Home Forums Event Espresso Premium Active message of an event

Active message of an event

Posted: May 11, 2018 at 5:42 am


motio

May 11, 2018 at 5:42 am

Hey,

one week before an event starts, we confirm the start to the attendee by switching the template of “registration approved” from “global” to a custom template “event starts” and send out the confirmation.

I would like to add a dynamic text on the event description which checks if the the global or custom template is active/connected to that event. I understand that I need the message typ and the GRP_ID for that. I can’t figure out how/where to get this to information.
Can you think of a method and class that I have to us for that?


Tony

  • Support Staff

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.

The support post ‘Active message of an event’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Tony 5 months ago ago

Topic Tags

Notifications

This topic is: resolved
Do NOT follow this link or you will be banned from the site!