Files
calendar/packages/features/ee/workflows/lib/reminders/utils.ts
T
a7727b5ca6 feat: shorten sms links using dub (#17925)
* feat: add getshortenLinks function

* feat: use shortenLinks in SMS Worflows

* chore: use getShortenLink and cleanup getShortenLinks

* fix: Duplicate keys error

---------

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
2025-01-06 12:39:54 +00:00

15 lines
358 B
TypeScript

import { dub } from "@calcom/features/auth/lib/dub";
export const getShortenLink = (link: string) => {
// don't hit dub with with empty string
if (!link.length) {
const pr: Promise<string> = new Promise((resolve) => resolve(link));
return pr;
} else {
return dub.links.create({
url: link,
domain: "sms.cal.com",
});
}
};