add link to new bookings email for admin

This commit is contained in:
Thomas Ruoff
2020-08-26 00:56:37 +02:00
parent a8525c5e34
commit b19b557b6c

View File

@@ -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)