diff --git a/src/emails/interfaces/create-email-options.interface.ts b/src/emails/interfaces/create-email-options.interface.ts index e02f9f6e..81056b0d 100644 --- a/src/emails/interfaces/create-email-options.interface.ts +++ b/src/emails/interfaces/create-email-options.interface.ts @@ -3,17 +3,77 @@ import { PostOptions } from '../../common/interfaces'; import { RequireAtLeastOne } from 'type-fest'; interface CreateEmailBaseOptions { + /** + * Filename and content of attachments (max 40mb per email) + * + * @link https://resend.com/api-reference/emails/send-email#body-parameters + */ attachments?: Attachment[]; + /** + * Blind carbon copy recipient email address. For multiple addresses, send as an array of strings. + * + * @link https://resend.com/api-reference/emails/send-email#body-parameters + */ bcc?: string | string[]; + /** + * Carbon copy recipient email address. For multiple addresses, send as an array of strings. + * + * @link https://resend.com/api-reference/emails/send-email#body-parameters + */ cc?: string | string[]; + /** + * Sender email address. To include a friendly name, use the format `"Your Name "` + * + * @link https://resend.com/api-reference/emails/send-email#body-parameters + */ from: string; + /** + * Custom headers to add to the email. + * + * @link https://resend.com/api-reference/emails/send-email#body-parameters + */ headers?: Record; + /** + * The React component used to write the message. + * + * @link https://resend.com/api-reference/emails/send-email#body-parameters + */ react?: React.ReactElement | React.ReactNode | null; + /** + * The HTML version of the message. + * + * @link https://resend.com/api-reference/emails/send-email#body-parameters + */ html?: string; + /** + * The plain text version of the message. + * + * @link https://resend.com/api-reference/emails/send-email#body-parameters + */ text?: string; + /** + * Reply-to email address. For multiple addresses, send as an array of strings. + * + * @link https://resend.com/api-reference/emails/send-email#body-parameters + */ reply_to?: string | string[]; + /** + * Email subject. + * + * @link https://resend.com/api-reference/emails/send-email#body-parameters + */ subject: string; + /** + * Email tags + * + * @link https://resend.com/api-reference/emails/send-email#body-parameters + */ tags?: Tag[]; + /** + * Recipient email address. For multiple addresses, send as an array of strings. Max 50. + * + * @link https://resend.com/api-reference/emails/send-email#body-parameters + */ to: string | string[]; } @@ -25,13 +85,26 @@ export type CreateEmailOptions = RequireAtLeastOne< export interface CreateEmailRequestOptions extends PostOptions {} export interface CreateEmailResponse { + /** The ID of the newly created email. */ id: string; } interface Attachment { + /** Content of an attached file. */ content?: string | Buffer; + /** Name of attached file. */ filename?: string | false | undefined; + /** Path where the attachment file is hosted */ path?: string; } -export type Tag = { name: string; value: string }; +export type Tag = { + /** + * The name of the email tag. It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-). It can contain no more than 256 characters. + */ + name: string; + /** + * The value of the email tag. It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-). It can contain no more than 256 characters. + */ + value: string; +};