UNPKG

emailengine-client

Version:

A TypeScript client for the EmailEngine API

238 lines (237 loc) 6.7 kB
import { MessageReference } from "../../../../misc/models/MessageReference"; import { Options } from "../../../../misc/Options"; import { UploadAttachment } from "../../../../misc/models/UploadAttachment"; /** * Submit message for delivery. If reference message ID is provided then EmailEngine adds all headers and flags required for a reply/forward automatically. */ export declare class SubmitMessageForDeliveryOptions extends Options { /** * Override the EENGINE_TIMEOUT environment variable for a single API request (in milliseconds) */ 'x-ee-timeout'?: number | undefined; /** * Account ID */ 'account': string; /** * Submit Message for Delivery Details */ 'body': { /** * Message reference for a reply or a forward. This is EmailEngine specific ID, not Message-ID header value. */ reference?: MessageReference; /** * Optional SMTP envelope. If not set then derived from message headers. */ envelope?: { /** * From address */ from: string; /** * List of addresses */ to: string[]; }; /** * Base64 encoded email message in rfc822 format. If you provide other keys as well then these will override the values in the raw message. */ raw?: string; /** * The From address */ from?: { /** * name */ name?: string; /** * address */ address: string; }; /** * List of Reply-To addresses */ replyTo?: { /** * name */ name?: string; /** * address */ address: string; }[]; /** * List of recipient addresses */ to?: { name?: string; address: string; }[]; /** * List of CC addresses */ cc?: { name?: string; address: string; }[]; /** * List of BCC addresses */ bcc?: { name?: string; address: string; }[]; /** * Message subject */ subject?: string; /** * Message Text */ text?: string; /** * Message HTML */ html?: string; /** * Preview text appears in the inbox after the subject line */ previewText?: string; /** * Stored template ID to load the email content from */ template?: string; /** * Template rendering options */ render?: { /** * Markup language for HTML ("html", "markdown" or "mjml") */ format?: string; /** * An object of variables for the template renderer */ params?: any; }; /** * Mail merge options. A separate email is generated for each recipient. Using mail merge disables messageId, envelope, to, cc, bcc, render keys for the message root. */ mailMerge?: { /** * To address */ to: { /** * name */ name?: string; /** * address */ address: string; }; /** * Message ID */ messageId?: string; /** * An object of variables for the template renderer */ params?: any; /** * Send message at specified time. Overrides message level sendAt value. */ sendAt?: string; }[]; /** * List of attachments */ attachments?: UploadAttachment[]; /** * Message ID */ messageId?: string; /** * Custom Headers */ headers?: any; /** * Should EmailEngine track clicks and opens for this message */ trackingEnabled?: boolean; /** * If set then either copies the message to the Sent Mail folder or not. If not set then uses the account's default setting. */ copy?: boolean; /** * Upload sent message to this folder. By default the account's Sent Mail folder is used. */ sentMailPath?: string; /** * Optional locale */ locale?: string; /** * Optional timezone */ tz?: string; /** * Send message at specified time */ sendAt?: string; /** * How many delivery attempts to make until message is considered as failed */ deliveryAttempts?: number; /** * Optional SMTP gateway ID for message routing */ gateway?: string; /** * List ID for Mail Merge. Must use a subdomain name format. Lists are registered ad-hoc, so a new identifier defines a new list. */ listId?: string; /** * Request DNS notifications */ dsn?: { /** * The envelope identifier that would be included in the response (ENVID) */ id?: string; /** * Specifies if only headers or the entire body of the message should be included in the response (RET) */ return: string; /** * Defines the conditions under which a DSN response should be sent */ notify?: string[]; /** * The email address the DSN should be sent (ORCPT) */ recipient?: string; }; /** * Optional base URL for trackers. This URL must point to your EmailEngine instance. */ baseUrl?: string; /** * Optional proxy URL to use when connecting to the SMTP server */ proxy?: string; /** * Optional local IP address to bind to when connecting to the SMTP server */ localAddress?: string; /** * If true, then EmailEngine does not send the email and returns an RFC822 formatted email file. Tracking information is not added to the email. */ dryRun?: boolean; }; }