One of our clients had the need to display calendar links in an email which was being sent out after the user signed up for an event. The event registration was being handled as a Weform submission and and email was being sent out to the user after they had submitted the form. We had no easy way to add the calendar links in as the markup required was quite complex.
One possible alternative was the Calendar Link module. It provides twig functions for converting a link into an invite. This was not of use to us because we wanted to convert the link to an invite in an email, rather than a web page. The natural solution was to extend the token system to do this for us.
The Calendar Links Token module is the simple solution. It makes use of the Calendar Links library to implement a token which can be used in Drupal. We have used it in emails, however it could be used in other situations.
The token has quite a number of options to handle the various fields which can be used when creating links for the various calendar services.
[calendar_links:parameters:nid|date_start_field|date_end_field|title_field|description_field|location_field]
The module page has a few examples of how this can be used.
The output of the token shows links to the common calendar services:
This tiny little module has allowed us to build a simple event registration system which provides a better user experience, allowing users to easily add the event to their calendars once they have signed up.
We hope you find this module of use in one of your projects.