From 18dc0194686c9cd8114e4f2247617ccbbc27fcb2 Mon Sep 17 00:00:00 2001 From: Martijn Date: Mon, 10 Aug 2020 15:40:51 +0200 Subject: [PATCH] Added Google Calendar link to email --- app/helpers.php | 7 ++++++- resources/views/emails/signin/confirmed.blade.php | 7 +++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/helpers.php b/app/helpers.php index bf7df31e..fbebd50d 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -23,4 +23,9 @@ function formatDate($date, $addEnter = false, $withTime = true, $withDay = true) function formatTime($date){ $timestamp = strtotime($date); return htmlspecialchars(date('H:i', $timestamp)); -} \ No newline at end of file +} + +function formatDateISO8601($date,$time){ + $timestamp = strtotime("$date" . " $time"); + return htmlspecialchars(date_format($timestamp,DATE_ISO8601)); +} diff --git a/resources/views/emails/signin/confirmed.blade.php b/resources/views/emails/signin/confirmed.blade.php index 3854c47d..efc4a8e6 100644 --- a/resources/views/emails/signin/confirmed.blade.php +++ b/resources/views/emails/signin/confirmed.blade.php @@ -67,7 +67,6 @@ Met vriendelijke groet,
De mensacomputer -Vragen of problemen? Bel de bar: {{ config('mensa.contact.bar') }} -@endcomponent - - +Vragen of problemen? Bel de bar: {{ config('mensa.contact.bar') }}
+Voeg toe aan je eigen agenda: https://calendar.google.com/calendar/r/eventedit?text=Mensa&dates={{formatDateISO8601($mensaUser->mensa->date,$mensaUser->mensa->closingTime()}}&details=Mijn+inschrijving:+{{ route('signin.edit', [$mensaUser->confirmation_code]) }}&Studentenvereniging+V.S.L.+Catena,+Kolfmakersteeg 8,+2311+VG+Leiden,+Netherlands +@endcomponent \ No newline at end of file