Event End Date in Individual and Group Email

  • Dryfive
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
12 years 3 weeks ago #15154 by Dryfive
Is it possible to add the event's end date (for events that go more than one day) to the emails that an individual and group receive during event registration. I found the following code in the com_eventbooking -> emailtemplates -> group_detail.php and individual_detail.php files:
Code:
<tr> <td class="title_cell"> <?php echo JText::_('EB_EVENT_DATE') ?> </td> <td class="field_cell"> <?php if ($this->rowEvent->event_date == EB_TBC_DATE) { echo JText::_('EB_TBC'); } else { echo JHTML::_('date', $this->rowEvent->event_date, $this->config->event_date_format, $param) ; } ?> </td> </tr>

And was thinking of adding:
Code:
<tr> <td class="title_cell"> <?php echo JText::_('EB_EVENT_DATE') ?> </td> <td class="field_cell"> <?php if ($this->rowEvent->event_date == EB_TBC_DATE) { echo JText::_('EB_TBC'); } else { echo JHTML::_('date', $this->rowEvent->event_date, $this->config->event_date_format, $param) ; } ?> </td> </tr> <tr> <td class="title_cell"> <?php echo JText::_('EB_EVENT_END_DATE') ?> </td> <td class="field_cell"> <?php if ($this->rowEvent->event_end_date == EB_TBC_DATE) { echo JText::_('EB_TBC'); } else { echo JHTML::_('date', $this->rowEvent->event_end_date, $this->config->event_date_format, $param) ; } ?> </td> </tr>

Not sure about the "EB_TBC_DATE" as to whether that would need to be changed as well, but any help would be appreciated!

Thanks!

Please Log in or Create an account to join the conversation.

More
12 years 3 weeks ago #15158 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Event End Date in Individual and Group Email
Hi

The code you wrote is correct and you can use it to show event end date in the email . EB_TBC_DATE is just used when you have an event which you still unsure about the date. When you create an event and set event date to 2099-12-31 00:00:00, the system will display the text "To be Confirmed" instead of displaying event date in the front-end.

In this case, you don't have to worry about it .

Tuan

Please Log in or Create an account to join the conversation.

  • Dryfive
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
12 years 3 weeks ago #15161 by Dryfive
Thanks Tuan!

Please Log in or Create an account to join the conversation.

  • Dryfive
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
12 years 3 weeks ago #15167 by Dryfive
Hi Tuan,

I applied the code and ran a few tests. The End Date in the email messages shows as today's date and time (the time the course was registered) instead of showing the course's end date and time as displayed when viewing the event's information on the site.

Thanks

Please Log in or Create an account to join the conversation.

More
12 years 3 weeks ago #15177 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Event End Date in Individual and Group Email
Oh, sorry. Look at the code again and found that you will need to modify code in one more place . The steps are :

1. Open the file components/com_eventbooking/helper/helper.php

2. Find the function getEmailContent

3. Look for the line of code below :
Code:
$sql = 'SELECT event_date, title, params FROM #__eb_events WHERE id='.$row->event_id ;

4. Change it to :
Code:
$sql = 'SELECT event_date, event_end_date, title, params FROM #__eb_events WHERE id='.$row->event_id ;

After that, it will work as expected .

Tuan

Please Log in or Create an account to join the conversation.

  • Dryfive
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
12 years 3 weeks ago #15198 by Dryfive
Perfect!

Thanks again Tuan.

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc