Any ideas how to display event URL in ics-file?

  • Holger Dexheimer
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 9 months ago #100177 by Holger Dexheimer
Any ideas how to display event URL in ics-file? was created by Holger Dexheimer
Hello,

I have already looked araound but wasn't able to find a matching thread / answer...

I'm currently struggling with the description displayed in ics-file.
By default it takes the events short description, but this doesn't match our notion.

I wolud like to replace with something like: For further information please visit www.domain.com/event_detail_page

Any ideas how to manage this?
Thanks in advance!

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

More
6 years 9 months ago #100195 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Any ideas how to display event URL in ics-file?
Hello Holger

This is unfortunately, could not be configured. You will need to customize the code yourself if you want to change this behavior. Try to look at the file components/com_eventbooking/helper/mail.php, find the method sendEmails, there are code like this in the method
Code:
$ics = new EventbookingHelperIcs(); $ics->setName($event->title) ->setDescription($event->short_description) ->setOrganizer(static::$fromEmail, static::$fromName) ->setStart($event->event_date) ->setEnd($event->event_end_date);

You will need to replace $event->short_description with the text you want for each event here. Not sure what's the best way to do, thought

Tuan

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

  • Holger Dexheimer
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 9 months ago #100211 by Holger Dexheimer
Replied by Holger Dexheimer on topic Any ideas how to display event URL in ics-file?
Hi Tuan,

thanks a lot - this provided my the way to solve it.
It takes only 2 minor modifications...

First change in file components/com_eventbooking/helper/mail.php:
Code:
//Generate and send ics file to registrants if ($config->send_ics_file) { $ics = new EventbookingHelperIcs(); $ics->setName($event->title) ->setDescription($event->alias) // ->setDescription($event->short_description) ->setOrganizer(static::$fromEmail, static::$fromName) ->setStart($event->event_date) ->setEnd($event->event_end_date);

Second change in file components/com_eventbooking/helper/ics.php:
Code:
public function setDescription($body) { $description = strip_tags($body); // $description = str_replace("\r\n", "", $description); // $description = str_replace(" ", "", $description); $description = "For further information on the chosen event please visit: ".JUri::base()."kursangebot/".$description; $this->description = $description; return $this;
I'm only wondering, if there is no possibility to use a tag like [EVENT_LINK]...

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

More
6 years 9 months ago - 6 years 9 months ago #100242 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Any ideas how to display event URL in ics-file?
We never use that tag in code like that. The tag is only needed in invoice layout and email message and invoice layout

If we need to get event details link in the code, use this syntax:
Code:
if (JFactory::getApplication()->isSite()) { $replaces['event_link'] = JUri::getInstance()->toString(array('scheme', 'user', 'pass', 'host')) . JRoute::_(EventbookingHelperRoute::getEventRoute($row->event_id, 0, EventbookingHelper::getItemid())); } else { $replaces['event_link'] = JUri::getInstance()->toString(array('scheme', 'user', 'pass', 'host')) . '/' . EventbookingHelperRoute::getEventRoute($row->event_id, 0, EventbookingHelper::getItemid()); }

of course $row->event_id need to replaced with the variable store ID of the event

Regards,

Tuan
Last edit: 6 years 9 months ago by Tuan Pham Ngoc.

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

Moderators: Tuan Pham Ngoc