export interface Address { email: string; name?: string | null; } export interface Attachment { name: string; type: string; content: string; } export interface Header { key: string; value: string; } export interface CreateEmailRequest { from: Address; to?: Address[]; cc?: Address[]; bcc?: Address[]; subject?: string; text?: string; html?: string; project_id: string; attachments?: Attachment[]; send_before?: string; additional_headers?: Header[]; } export type DraftEmail = Omit; export interface Email { id: string; message_id: string; project_id: string; mail_from: string; mail_rcpt: string; rcpt_type: 'to' | 'cc' | 'bcc' | 'unknown_rcpt_type'; subject: string; created_at: string; updated_at: string; status: 'new' | 'sending' | 'sent' | 'failed' | 'canceled' | 'unknown'; status_details?: string | null; try_count: number; last_tries: EmailTry[]; flags: EmailFlag[]; } export interface EmailTry { rank: number; tried_at: string; code: number; message: string; } export type EmailFlag = 'unknown_flag' | 'soft_bounce' | 'hard_bounce' | 'spam' | 'mailbox_full' | 'mailbox_not_found' | 'greylisted' | 'send_before_expiration' | 'blocklisted';