import type { Campaign } from './Campaign'; import type { ContactRef } from './Contact'; import type { EmailRecipientRef } from './EmailRecipient'; import type { NewsroomRef } from './Newsroom'; import type { SenderAddress } from './SenderAddress'; import type { SenderDomain } from './SenderDomain'; import type { StoryRef } from './Story'; import type { UserRef } from './User'; export interface Pitch { followup_to?: { id: number; type: 'campaign' | 'pitch'; subject: string; } | null; quoted_email_content?: string | null; followup_cc?: Pitch.Copy[]; id: number; type: 'pitch'; subject: string; status: Pitch.Status; workflow_statuses: Pitch.WorkflowStatus[]; from: { name: string; email_address: string; }; created_at: string; updated_at: string; sent_at: string | null; delivered_at: string | null; scheduled_at: string | null; is_draft: boolean; is_finalized: boolean; is_scheduled: boolean; is_processing: boolean; is_sent: boolean; is_demo: boolean; /** JSON-serialized document in Prezly Content Format. */ email_content: string; story_alignment: Campaign.StoryAlignment; story_appearance: Campaign.StoryAppearance; story_header_footer: Campaign.StoryHeaderFooter; recipient: EmailRecipientRef | null; /** Existing CC and BCC recipients. Copies are read-only in the public pitch workflow. */ copies: Pitch.Copy[]; author: UserRef; sender: SenderAddress | null; story: StoryRef | null; /** * A story rendered at the bottom of the email that the pitch is not "about". * * Unlike `story`, this one may belong to another license: attaching a foreign story would * hand the pitch that license's newsroom, and with it the wrong subscription and unsubscribe * lookups, so it is rendered instead. Shares the story_* display settings above. */ embedded_story: StoryRef | null; newsroom: NewsroomRef | null; is_open_tracking_enabled: boolean; is_click_tracking_enabled: boolean; sender_domain_verification_flow: SenderDomain.VerificationFlowVersion | null; sender_domain_verification_status: Campaign.SenderDomainVerificationStatus; thumbnail_url: string; stats: Pitch.Stats; } export declare namespace Pitch { enum Status { DRAFT = "draft", FINAL = "final", SENT = "sent" } enum WorkflowStatus { DRAFT = "draft", SCHEDULED = "scheduled", SENT = "sent", DELIVERED = "delivered", UNDELIVERED = "undelivered", OPENED = "opened", CLICKED = "clicked" } interface Copy { id: string; type: 'cc' | 'bcc'; contact: ContactRef; email: string; } interface Stats { recipients: number; delivered: number; clicks: number; opens: number; bounces: number; skipped: number; unsubscribes: number; clicks_rate: number; opens_rate: number; unsubscribes_rate: number; } function isDraft(pitch: Pick): boolean; function isSent(pitch: Pick): boolean; }