// Email receipt settings shared between client and server. Receipts go out
// through Gmail SMTP using an app password for the platform Gmail address.

export const DEFAULT_EMAIL_ADDRESS = 'creativeakotoansah@gmail.com'
export const DEFAULT_EMAIL_FROM_NAME = 'AkotoCreative SMS'

// The Gmail settings an admin can enter on /admin/settings.
export const EMAIL_FIELDS = [
  { key: 'address', env: 'GMAIL_USER', label: 'Gmail address', secret: false, hint: `The Gmail account receipts are sent from. Defaults to ${DEFAULT_EMAIL_ADDRESS}.` },
  { key: 'appPassword', env: 'GMAIL_APP_PASSWORD', label: 'App password', secret: true, hint: 'The 16-character app password created for this Gmail account (not your normal Gmail password).' },
  { key: 'fromName', env: 'GMAIL_FROM_NAME', label: 'Sender name', secret: false, hint: `The name customers see in their inbox. Defaults to “${DEFAULT_EMAIL_FROM_NAME}”.` },
] as const

export type EmailFieldKey = (typeof EMAIL_FIELDS)[number]['key']

export const EMAIL_DEFAULTS: Record<EmailFieldKey, string> = {
  address: DEFAULT_EMAIL_ADDRESS,
  appPassword: '',
  fromName: DEFAULT_EMAIL_FROM_NAME,
}
