export function organizationInviteEmail({
  email,
  firstName,
  inviterName,
  organizationName,
  inviteToken,
  appName,
  siteUrl,
}: {
  email: string
  firstName: string
  inviterName: string
  organizationName: string
  inviteToken: string
  appName: string
  siteUrl: string
}) {
  const subject = `[${appName}] Invitation to join ${organizationName}`
  const url = `${siteUrl}/accept-invite?token=${inviteToken}`

  const text = [
    `Hi ${firstName || 'There'},\n`,
    `${inviterName} has invited you to join ${organizationName} on ${appName}.\n`,
    `To accept the invitation, click the link below:\n`,
    `${url}\n`,
    `If you do not wish to join, you can ignore this email.\n`,
    `Thanks,\n`,
    `The ${appName} Team\n`,
  ].join('')

  const html = [
    `<p>Hi ${firstName || 'There'},</p>`,
    `<p>${inviterName} has invited you to join <b>${organizationName}</b> on ${appName}.</p>`,
    `<p>To accept the invitation, click the link below:</p>`,
    `<p><a href="${url}">Accept Invitation</a></p>`,
    `<p>If you do not wish to join, you can ignore this email.</p>`,
    `<p>Thanks,<br />The ${appName} Team</p>`,
  ].join('')

  return {
    to: email,
    subject,
    html,
    text,
  }
} 