Frodo Library - v5.0.0-47
    Preparing search index...

    Type Alias EmailTemplate

    type EmailTemplate = {
        EMAIL_TEMPLATE_TYPE: string;
        createEmailTemplate(
            templateId: string,
            templateData: EmailTemplateSkeleton,
        ): Promise<EmailTemplateSkeleton>;
        createEmailTemplateExportTemplate(): EmailTemplateExportInterface;
        deleteEmailTemplate(templateId: string): Promise<EmailTemplateSkeleton>;
        deleteEmailTemplates(): Promise<EmailTemplateSkeleton[]>;
        exportEmailTemplates(
            includeDefault?: boolean,
        ): Promise<EmailTemplateExportInterface>;
        importEmailTemplates(
            importData: EmailTemplateExportInterface,
            resultCallback?: ResultCallback<EmailTemplateSkeleton>,
        ): Promise<EmailTemplateSkeleton[]>;
        readEmailTemplate(templateId: string): Promise<EmailTemplateSkeleton>;
        readEmailTemplates(
            includeDefault?: boolean,
        ): Promise<EmailTemplateSkeleton[]>;
        updateEmailTemplate(
            templateId: string,
            templateData: EmailTemplateSkeleton,
        ): Promise<EmailTemplateSkeleton>;
    }
    Index
    EMAIL_TEMPLATE_TYPE: string

    Email template type key used to build the IDM id: 'emailTemplate/'

    • Export all email templates. The response can be saved to file as is.

      Parameters

      • OptionalincludeDefault: boolean

        Include default email templates if true, false to exclude them. Default: false

      Returns Promise<EmailTemplateExportInterface>

      Promise resolving to a EmailTemplateExportInterface object.

    • Import all email templates. Every email template is tried: a template that cannot be imported does not stop the others.

      Parameters

      • importData: EmailTemplateExportInterface

        import data

      • OptionalresultCallback: ResultCallback<EmailTemplateSkeleton>

        Optional callback to process individual results. When given, the outcome of every email template is passed to it as it happens (a failed template as an error that names the template and carries the cause) and a failed template does not throw: the templates that were imported are returned. Without it, the failures are collected and thrown as one error after every template was tried.

      Returns Promise<EmailTemplateSkeleton[]>

      a promise resolving to an array of email template objects

      If one or more email templates cannot be imported and there is no result callback. The error carries one nested error per failed template.

    • Get all email templates

      Parameters

      • OptionalincludeDefault: boolean

        Include default email templates if true, false to exclude them. Default: false

      Returns Promise<EmailTemplateSkeleton[]>

      a promise that resolves to an array of email template objects