feat: initialize CalBook project with comprehensive scheduling, admin, and deployment infrastructure
This commit is contained in:
21
lib/email/shortcodes.ts
Normal file
21
lib/email/shortcodes.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
const DEFAULT_MEETING_BUTTON_SHORTCODES = [
|
||||
"{{meetingButton}}",
|
||||
"{{jitsiButton}}",
|
||||
"[meeting_button]",
|
||||
"[jitsi_button]"
|
||||
];
|
||||
|
||||
export function normalizeMeetingButtonTemplate(
|
||||
template: string,
|
||||
shortcodes: string[] = DEFAULT_MEETING_BUTTON_SHORTCODES
|
||||
) {
|
||||
if (!template) return template;
|
||||
|
||||
const hasShortcode = shortcodes.some((token) => template.includes(token));
|
||||
if (hasShortcode) return template;
|
||||
|
||||
return template
|
||||
.replace(/Jitsi-Link:\s*\{\{meetingUrl\}\}/gi, "{{meetingButton}}")
|
||||
.replace(/Jitsi:\s*\{\{meetingUrl\}\}/gi, "{{meetingButton}}")
|
||||
.replace(/\{\{meetingUrl\}\}/g, "{{meetingButton}}");
|
||||
}
|
||||
Reference in New Issue
Block a user