Skip to content

Instantly share code, notes, and snippets.

@jasonbyrne
Created January 20, 2023 21:33
Show Gist options
  • Save jasonbyrne/96b3df935844ca18bb39155e6ce6db66 to your computer and use it in GitHub Desktop.
Save jasonbyrne/96b3df935844ca18bb39155e6ce6db66 to your computer and use it in GitHub Desktop.
Email message as extracted by postal-mime from Cloudflare Email Router's raw property
export interface EmailAttachment {
filename: string;
mimeType: string;
disposition: string;
related: boolean;
contentId: string;
content: unknown;
}
export interface EmailAddress {
address: string;
name: string;
}
export interface EmailHeader {
key: string;
value: string;
}
export interface ExtractedEmailMessage {
headers: EmailHeader[];
from: EmailAddress;
to: EmailAddress[];
cc?: EmailAddress[];
bcc?: EmailAddress[];
replyTo?: EmailAddress;
sender?: EmailAddress;
messageId: string;
inReplyTo: string;
references: string;
date: string;
html: string;
text: string;
attachments: EmailAttachment[];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment