mirror of
https://github.com/simstudioai/sim.git
synced 2026-10-24 11:36:37 +08:00
* progress on cred sets * fix credential set system * return data to render credential set in block preview * progress * invite flow * simplify code * fix ui * fix tests * fix types * fix * fix icon for outlook * fix cred set name not showing up for owner * fix rendering of credential set name * fix outlook well known folder id resolution * fix perms for creating cred set * add to docs and simplify ui * consolidate webhook code better * fix tests * fix credential collab logic issue * fix ui * fix lint
64 lines
2.1 KiB
TypeScript
64 lines
2.1 KiB
TypeScript
import { getBrandConfig } from '@/lib/branding/branding'
|
|
|
|
/** Email subject type for all supported email templates */
|
|
export type EmailSubjectType =
|
|
| 'sign-in'
|
|
| 'email-verification'
|
|
| 'forget-password'
|
|
| 'reset-password'
|
|
| 'invitation'
|
|
| 'batch-invitation'
|
|
| 'polling-group-invitation'
|
|
| 'help-confirmation'
|
|
| 'enterprise-subscription'
|
|
| 'usage-threshold'
|
|
| 'free-tier-upgrade'
|
|
| 'plan-welcome-pro'
|
|
| 'plan-welcome-team'
|
|
| 'credit-purchase'
|
|
| 'welcome'
|
|
|
|
/**
|
|
* Returns the email subject line for a given email type.
|
|
* @param type - The type of email being sent
|
|
* @returns The subject line for the email
|
|
*/
|
|
export function getEmailSubject(type: EmailSubjectType): string {
|
|
const brandName = getBrandConfig().name
|
|
|
|
switch (type) {
|
|
case 'sign-in':
|
|
return `Sign in to ${brandName}`
|
|
case 'email-verification':
|
|
return `Verify your email for ${brandName}`
|
|
case 'forget-password':
|
|
return `Reset your ${brandName} password`
|
|
case 'reset-password':
|
|
return `Reset your ${brandName} password`
|
|
case 'invitation':
|
|
return `You've been invited to join a team on ${brandName}`
|
|
case 'batch-invitation':
|
|
return `You've been invited to join a team and workspaces on ${brandName}`
|
|
case 'polling-group-invitation':
|
|
return `You've been invited to join an email polling group on ${brandName}`
|
|
case 'help-confirmation':
|
|
return 'Your request has been received'
|
|
case 'enterprise-subscription':
|
|
return `Your Enterprise Plan is now active on ${brandName}`
|
|
case 'usage-threshold':
|
|
return `You're nearing your monthly budget on ${brandName}`
|
|
case 'free-tier-upgrade':
|
|
return `You're at 90% of your free credits on ${brandName}`
|
|
case 'plan-welcome-pro':
|
|
return `Your Pro plan is now active on ${brandName}`
|
|
case 'plan-welcome-team':
|
|
return `Your Team plan is now active on ${brandName}`
|
|
case 'credit-purchase':
|
|
return `Credits added to your ${brandName} account`
|
|
case 'welcome':
|
|
return `Welcome to ${brandName}`
|
|
default:
|
|
return brandName
|
|
}
|
|
}
|