@454creative/easy-email
Version:
A framework-agnostic email service library for Node.js with observability and monitoring
64 lines • 2.37 kB
TypeScript
/**
* Constants for the easy-email library
*/
export declare const EMAIL_CONSTANTS: {
readonly VALIDATION_MESSAGES: {
readonly SENDER_REQUIRED: "Sender email is required";
readonly RECIPIENT_REQUIRED: "Recipient is required";
readonly SUBJECT_REQUIRED: "Subject is required";
readonly NO_PROVIDER_CONFIGURED: "No email provider configured";
readonly SMTP_NOT_CONFIGURED: "SMTP transporter not configured";
readonly SES_REGION_REQUIRED: "SES region is required";
readonly SES_CREDENTIALS_REQUIRED: "SES credentials are required";
};
readonly ERROR_CODES: {
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
readonly CONFIG_ERROR: "CONFIG_ERROR";
readonly PROVIDER_ERROR: "PROVIDER_ERROR";
readonly CONNECTION_FAILED: "CONNECTION_FAILED";
readonly SES_ERROR: "SES_ERROR";
};
readonly PROVIDER_TYPES: {
readonly SMTP: "smtp";
readonly SENDGRID: "sendgrid";
readonly SES: "ses";
};
readonly TEMPLATE: {
readonly VARIABLE_REGEX: RegExp;
readonly DEFAULT_EXTENSION: ".html";
};
readonly CONTENT_TYPES: {
readonly TEXT_PLAIN: "text/plain";
readonly TEXT_HTML: "text/html";
};
readonly DEFAULTS: {
readonly FROM_NAME: "";
readonly ATTACHMENT_DISPOSITION: "attachment";
};
readonly LOG_MESSAGES: {
readonly EMAIL_SENT: "Email sent successfully";
readonly EMAIL_FAILED: "Failed to send email";
readonly CONNECTION_VERIFIED: "Connection verified successfully";
readonly CONNECTION_FAILED: "Connection verification failed";
};
};
export declare const OBSERVABILITY_CONSTANTS: {
readonly EVENT_TYPES: {
readonly EMAIL_SENT: "email_sent";
readonly EMAIL_FAILED: "email_failed";
readonly CONNECTION_VERIFIED: "connection_verified";
readonly CONNECTION_FAILED: "connection_failed";
};
readonly PROVIDER_NAMES: {
readonly SMTP: "smtp";
readonly SENDGRID: "sendgrid";
readonly SES: "ses";
};
readonly METRICS_KEYS: {
readonly TOTAL_SENT: "totalSent";
readonly TOTAL_FAILED: "totalFailed";
readonly SUCCESS_RATE: "successRate";
readonly AVERAGE_SEND_TIME: "averageSendTime";
};
};
//# sourceMappingURL=constants.d.ts.map