UNPKG

strapi-plugin-email-designer-5

Version:
41 lines (40 loc) 1.32 kB
import type { Core } from "@strapi/strapi"; import type { SendMailOptions } from "nodemailer"; import * as yup from "yup"; export type EmailTemplate = { /** * The subject of the email */ subject: string; /** * The text version of the email */ text: string; /** * The HTML version of the email */ html: string; }; export type ComposedTemplates = { html: string; text: string; }; export type ComposeParams<T> = { templateReferenceId: number; data?: T; }; export declare const isValidEmailSchema: yup.StringSchema<string, yup.AnyObject, undefined, "">; export declare const isTemplateReferenceIdSchema: yup.NumberSchema<number, yup.AnyObject, undefined, "">; export declare const pluginUID: string; declare const _default: ({ strapi }: { strapi: Core.Strapi; }) => { sendTemplatedEmail: <T extends Record<string, any>>(emailOptions?: Pick<SendMailOptions, "to" | "from" | "bcc" | "cc" | "attachments" | "headers" | "replyTo">, emailTemplate?: Partial<EmailTemplate> & { templateReferenceId: number; }, data?: T) => Promise<any>; compose: <T_1 extends Record<string, any>>({ templateReferenceId, data }: ComposeParams<T_1>) => Promise<{ composedHtml: string; composedText: string; }>; }; export default _default;