From b19b557b6cfb5203a5df9cbd14fc45404d381307 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Wed, 26 Aug 2020 00:56:37 +0200 Subject: [PATCH] add link to new bookings email for admin --- helpers/mail.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/helpers/mail.js b/helpers/mail.js index 88d98a2..c34b931 100644 --- a/helpers/mail.js +++ b/helpers/mail.js @@ -30,6 +30,14 @@ async function sendMail(data) { } } +function getReceivedBookingText(booking) { + return `Hallo lieber Admin, + + es ging folgende Buchung ein: https://${process.env.VERCEL_URL}/booking/${booking.uuid} + + MfG` +} + export async function sendReceivedBookingMail(booking) { const data = { personalizations: [ @@ -39,9 +47,7 @@ export async function sendReceivedBookingMail(booking) { ], from: { email: FROM_EMAIL }, subject: 'Pfadi Bussle - Buchung eingegangen!', - content: [ - { type: 'text/plain', value: `${JSON.stringify(booking, null, 4)}` }, - ], + content: [{ type: 'text/plain', value: getReceivedBookingText(booking) }], } await sendMail(data)