calcom/lib/CalEventParser.ts
Mihai C 8322e5c8d1
Emails Revamp (#1201)
* refactor: emails (WIP)

* wip

* wip

* refactor: calendarClient

* chore: remove comment

* feat: new templates

* feat: more templates (wip)

* feat: email templates wip

* feat: email templates wip

* feat: prepare for testing

* For testing stripe integration

* Uses imported BASE_URL

* Fixes types

* use BASE_URL

Co-authored-by: Omar López <zomars@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-11-26 11:03:43 +00:00

15 lines
460 B
TypeScript

import short from "short-uuid";
import { v5 as uuidv5 } from "uuid";
import { CalendarEvent } from "./calendarClient";
import { BASE_URL } from "./config/constants";
const translator = short();
export const getUid = (calEvent: CalendarEvent) => {
return calEvent.uid ?? translator.fromUUID(uuidv5(JSON.stringify(calEvent), uuidv5.URL));
};
export const getCancelLink = (calEvent: CalendarEvent) => {
return BASE_URL + "/cancel/" + getUid(calEvent);
};