Skip to content

feat: add email booking mail templates#999

Open
lenderom wants to merge 7 commits into
mainfrom
feat/email-booking-mail-templates
Open

feat: add email booking mail templates#999
lenderom wants to merge 7 commits into
mainfrom
feat/email-booking-mail-templates

Conversation

@lenderom

Copy link
Copy Markdown
Member

What

  • add reusable mail buttons for all email booking ways, including:
    • Send email (FIP 50 Ticket)
    • Send email (Reservation), where applicable
  • use per-page frontmatter templates via params.mail_templates so each booking way has its own subject/body/recipient
  • add a leading mail icon to mail buttons
  • fix mailto encoding to keep spaces in message text (%20 instead of +)
  • align all email templates for multi-traveler bookings with nested passenger blocks
  • align placeholders and wording consistency across de/en/fr content

Included booking pages

  • content/booking/attica-email/index.de.md
  • content/booking/attica-email/index.en.md
  • content/booking/attica-email/index.fr.md
  • content/booking/ffestiniogtravel-email/index.de.md
  • content/booking/ffestiniogtravel-email/index.en.md
  • content/booking/ffestiniogtravel-email/index.fr.md
  • content/booking/internationalrail-email/index.de.md
  • content/booking/internationalrail-email/index.en.md
  • content/booking/internationalrail-email/index.fr.md
  • content/booking/stena-line-bv-email/index.de.md
  • content/booking/stena-line-bv-email/index.en.md
  • content/booking/stena-line-bv-email/index.fr.md
  • content/booking/stena-line-limited-email/index.de.md
  • content/booking/stena-line-limited-email/index.en.md
  • content/booking/stena-line-limited-email/index.fr.md

Template/i18n changes

  • layouts/partials/booking-links.html
  • layouts/partials/button.html
  • i18n/de.yaml
  • i18n/en.yaml
  • i18n/fr.yaml

Depends on #998

Fixes #995

@lenderom lenderom added content Improvements or additions to the content (countries, news, operators, general content) technical Technical issues, e.g. related to Hugo, HTML, CSS, deployment, etc. labels Jun 13, 2026
@netlify

netlify Bot commented Jun 13, 2026

Copy link
Copy Markdown

Deploy Preview for fipguide ready!

Name Link
🔨 Latest commit b97cea4
🔍 Latest deploy log https://app.netlify.com/projects/fipguide/deploys/6a2ece44ba33ae00088a4805
😎 Deploy Preview https://deploy-preview-999--fipguide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Name: [Name (as in passport)]
Passenger 2:
Name: [Name (as in passport)]
[... Add or remove passengers if needed]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The language of the placeholder text is mixed. Sometimes it uses German (Anzahl Reisende), sometimes English (Add or remove passengers if needed).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Der Link wird auch auf der Eurostar Seite angezeigt, dort ergibt FIP 50 aber kein Sinn. Stattdessen bräuchten wir ein Template für Globalpreis.

Please find my details below:

Travel date: [Date du voyage]
Travel time: [Heure du voyage]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wäre wahrscheinlich sinnvoll, auch noch die Reiserichtung anzugeben, also entweder Harwich -> Hoek van Holland oder Hoek van Holland -> Harwich.

Comment thread layouts/partials/booking-links.html Outdated
@@ -1,4 +1,9 @@
{{- if or .Params.booking_link .Params.additional_info_link -}}
{{- $mailTemplates := .Params.mail_templates -}}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Müsste eher email_templates sein, mail steht im Englischen für Briefpost.

@MoritzWeber0 MoritzWeber0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool idea! In the future we could even try to build a form where users can fill the placeholder fields and then send it via email :)

@lenderom lenderom requested a review from MoritzWeber0 June 14, 2026 15:53
"Text" (T "booking.send-mail-reservation")
)
-}}
{{- end -}}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be better solved with a for loop by iterating over fip_50, fip_75, fip_global_fare and reservations.
The variables $Xemail and $showXEmailButton can be defined in the loop body. We also don't need separate translation keys for each different email type as it doesn't differ from the original translation. So (T "booking.send-mail") + "(" + (T "booking.reservation") + ")" is already sufficient.

In the booking partial we already have a variable $metaFields the we can iterate over. We could just pass it to the booking-links partial and reuse it there. Currently, we don't pass a dict to the booking-links partial, but this will change in #856 anyway.

{{- $globalFareEmail := and $emailTemplates (index $emailTemplates "fip_global_fare") -}}
{{- $reservationEmail := and $emailTemplates (index $emailTemplates "reservations") -}}
{{- $showGlobalFareEmailButton := and (eq .Params.type "email") (eq .Params.fip_global_fare true) $globalFareEmail $globalFareEmail.to $globalFareEmail.subject $globalFareEmail.body -}}
{{- $showFip50EmailButton := and (eq .Params.type "email") (eq .Params.fip_50 true) $fip50Email $fip50Email.to $fip50Email.subject $fip50Email.body -}}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already better than before, but it still doesn't consider the attributes passed to the shortcode. For example, "International Rail Ltd. Email" on the Eurostar page still shows the the fip_50 email option, even though it's set as fip_50=nil in the attributes.

If you use the $metaFields as described in the other comment, you can "value" key of the dict to access the passed attribute.

Base automatically changed from fix/stena-line-booking-requirements-995 to main June 16, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content Improvements or additions to the content (countries, news, operators, general content) technical Technical issues, e.g. related to Hugo, HTML, CSS, deployment, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants