UNPKG

adonis-mailbuilder

Version:
87 lines (86 loc) 2.32 kB
declare module '@ioc:Adonis/Addons/MailBuilder' { import { Content, Option } from 'mailgen'; export interface MailBuilderRenderResponseInterface { html: string; text: string; } export interface MailBuilder { render(mailInstance: MailBuilderInterface, isTest?: boolean): Promise<MailBuilderRenderResponseInterface>; } export interface MailBuilderConfig { devPort?: string; mailOption: Option; } export interface MailBuilderMailOptionsInterface { content: Content; option?: Option; } export interface MailBuilderInterface { data: any; getMockData(): Promise<any>; options(isTest: boolean): Promise<MailBuilderMailOptionsInterface>; } const MailBuilder: MailBuilder; export default MailBuilder; } declare module 'mailgen' { export class Mailgen { constructor(opts: Option); cacheThemes(): void; generate(params: Content): any; generatePlaintext(params: Content): any; parseParams(params: any): any; } export default Mailgen; export interface Option { theme: 'default' | 'neopolitan' | 'salted' | 'cerberus' | CustomTheme; product: Product; } interface CustomTheme { path: string; plaintextPath?: string; } interface Product { name: string; link: string; logo?: string; copyright?: string; } export interface Content { body: ContentBody; } interface ContentBody { name?: string; greeting?: string; signature?: string; title?: string; intro?: string | string[]; action?: Action | Action[]; table?: Table | Table[]; dictionary?: any; goToAction?: GoToAction; outro?: string | string[]; } interface Table { data: any[]; columns?: ColumnOptions; } interface ColumnOptions { customWidth: any; customAlignment: any; } interface GoToAction { text: string; link: string; description: string; } interface Action { instructions: string; button: Button; } interface Button { color?: string; text: string; link: string; } }