Created on 13 January 2023, almost 2 years ago
Updated 20 June 2023, over 1 year ago

Problem/Motivation

Links do not display in the email

I followed the instructions from the module page and
https://www.morpht.com/blog/announcing-calendar-links-token-module

Steps to reproduce

Installed module & library with composer
Enabled the module
Created a form with fields :
Description : message
Starting date : date_d_arrivee
End date : date_de_depart
Created email with tokens
[calendar_links:parameters:nid|date_d_arrivee|date_de_depart|title_field|message]

I filled in the form, submitted,
All tokens in the email are replaced with the corresponding values

The [calendar_links:parameters:nid|date_d_arrivee|date_de_depart|title_field|message] is display as.
No links to add the submission to calendar is displayed.

Cheers

🐛 Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

🇫🇷France mchamps Finistère

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India sharayurajput

    I will work on this issue

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India sharayurajput

    Please review this patch

  • 🇫🇷France mchamps Finistère

    Thanks for the patch but it is not working.

    I create an email handler and add the token in the message > body part.

    It does appear in the list of available tokens :
    Calendar links calendar_links Tokens to embed calendar links.
    Parameters [calendar_links:parameters:?] Embed calendar links using tokens. The following values may be appended to the token: calendar_links:parameters:start|end|title|description|location

    When i use the tokens to display the values it works [webform_submission:values:date_d_arrivee] or [webform_submission:values:date_de_depart].

    I tried with only one token : [calendar_links:parameters:message]
    The email message displays the tokens, not the values

    I ran composer require spatie/calendar-links to install it.
    I went to /web/libraries to check and the library calendar-links does not appear. Would it be in a subfolder?
    I downloaded and extracted the code directly from GitHub : wget https://github.com/spatie/calendar-links/archive/refs/heads/master.zip
    Used drush cache-rebuilt
    No luck either

  • 🇯🇵Japan eleonel Itoshima 🇯🇵

    Hi, are you replacing the nid with the real number in the token? example [calendar_links:parameters:123|date_d_arrivee|date_de_depart|title_field|message]

  • 🇫🇷France mchamps Finistère

    Nope I did not, this time.. I though is was working with the current submission.
    I'm working with email handlers...

    Here's what I've just tried :
    -- The title of the submission is : Booking form: Submission #514
    So I tried with [calendar_links:parameters:514|date_d_arrivee|date_de_depart]
    -- The URL of the submission is : /admin/structure/webform/manage/reservation_form/submission/545
    So I tried with [calendar_links:parameters:545|date_d_arrivee|date_de_depart]

    I tried again [calendar_links:parameters:nid|date_d_arrivee|date_de_depart]

    None worked.

    Why would I have to replace the nid with the real number of the token?
    Then I would need to do it for each webform submission?

    Thanks for your help & suggestions.

  • 🇯🇵Japan eleonel Itoshima 🇯🇵

    Please check my examples on the comment #5, the nid comes from a node where you have all the information about the event, is not necessary a webform node, it could be a simple page, article or more commonly an event node.

  • 🇫🇷France mchamps Finistère

    I have read your examples, a few times, and read your documentation also https://www.morpht.com/blog/announcing-calendar-links-token-module
    It is obviously not clear or easy to understand for me... sorry.

    I run a BnB and I would like to use your module with my booking webform. I found the link for it in /admin/structure/webform/addons.
    My idea is to send an automated email, once I have validated the booking, with the links to add the booking to my Google calendar on Thunderbird.
    I have create an email handler /admin/structure/webform/manage/reservation_form/handlers
    For the body, I selected "Custom body..." and added your code to it : [calendar_links:parameters:nid|date_d_arrivee|date_de_depart|nom|message|formules]

    In my form
    date_d_arrivee : Date field for arrival
    date_de_depart : Date field for departure
    nom : Text field for the title
    message : Textarea for description
    formules : Entity radio to pick which room they want

    The body of the email handler is :

    [webform_submission:values:date_d_arrivee] to [webform_submission:values:date_de_depart].
    [calendar_links:parameters:nid|date_d_arrivee|date_de_depart|nom|message|formules]
    

    When I validate the booking, I receive the email

    12/12/23 to 16/12/23.
    [calendar_links:parameters:nid|date_d_arrivee|date_de_depart|nom|message|formules]

    How do I get the nid of the submission ?
    I tried with the number in the URL /admin/structure/webform/manage/testing_booking_form/submission/547/edit
    as I would do for a node.

    How can I get it to work with the current submission ?

    Thanks for your time and explanations.
    Have a good one

  • 🇫🇷France mchamps Finistère

    I've just added this token to the email handler's body : [webform_submission:node:nid]

    I receive the email with [webform_submission:node:nid] instead of its value.
    So I guess the webform submission does not have an nid in this case...

  • Status changed to Closed: works as designed over 1 year ago
  • 🇯🇵Japan eleonel Itoshima 🇯🇵

    [calendar_links:parameters:nid|date_start_field|date_end_field|title_field|description_field|location_field]

    nid is the id of a node with fields date_start_field, date_end_field, title_field, description_field and location_field, not the webform id or submission id

    This module doesn't use the webform as source to fill out the fields used in the token, it use a node, and you need to specify which node by entering the correct nid, like my examples on #5 🐛 Does not work Closed: works as designed

  • 🇫🇷France mchamps Finistère

    Thanks for making it all clear.
    You might want to remove this module from the Webform add-on page as it does not use the webform as a source. /admin/structure/webform/addons.

Production build 0.71.5 2024