mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
add url helper
This commit is contained in:
committed by
Thomas Ruoff
parent
56c8263e90
commit
cd5fa56807
@@ -1,3 +1,5 @@
|
||||
import { getBaseURL } from './url'
|
||||
|
||||
const SENDGRID_API_KEY = process.env.SENDGRID_API_KEY
|
||||
const SENDGRID_URL = 'https://api.sendgrid.com/v3/mail/send'
|
||||
// TODO: move to env
|
||||
@@ -31,7 +33,7 @@ async function sendMail(data: object) {
|
||||
function getReceivedBookingText(booking: { uuid: string }) {
|
||||
return `Hallo lieber Admin,
|
||||
|
||||
es ging folgende Buchung ein: https://${process.env.VERCEL_URL}/booking/${booking.uuid}
|
||||
es ging folgende Buchung ein: {getBaseURL()}/booking/${booking.uuid}
|
||||
|
||||
MfG`
|
||||
}
|
||||
|
||||
7
helpers/url.ts
Normal file
7
helpers/url.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
const URL = process.env.VERCEL_URL
|
||||
? `https://${process.env.VERCEL_URL}`
|
||||
: 'http://localhost:3000'
|
||||
|
||||
export function getBaseURL(): string {
|
||||
return URL
|
||||
}
|
||||
Reference in New Issue
Block a user