MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / generateUnsubscribeToken

Function generateUnsubscribeToken

packages/email/src/unsubscribe.ts:9–12  ·  view source on GitHub ↗
(email: string, category: string)

Source from the content-addressed store, hash-verified

7 'default-secret-change-in-production';
8
9export function generateUnsubscribeToken(email: string, category: string): string {
10 const data = `${email}:${category}`;
11 return createHmac('sha256', SECRET).update(data).digest('hex');
12}
13
14export function verifyUnsubscribeToken(
15 email: string,

Callers 2

verifyUnsubscribeTokenFunction · 0.85
getUnsubscribeUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected