import { MailService } from "@sendgrid/mail"; import { JSONObject } from "kuzzle"; import { BaseAccount, MessengerClient } from "./MessengerClient"; import { SendgridAttachment } from "lib/types"; export interface SendgridAccount extends BaseAccount { options: { /** * Default sender email address */ defaultSender: string; }; } export declare class SendgridClient extends MessengerClient { constructor(); /** * Sends an email using one of the registered accounts. * * @param accountName Account name * @param to Recipient email(s) * @param subject Email subject * @param html Email content * @param options.from Sender email * @param options.attachments Attachments to be included in the email */ sendEmail(accountName: string, to: string[], subject: string, html: string, { from, attachments, }?: { from?: string; attachments?: SendgridAttachment[]; }): Promise; /** * Sends a templated email using one of the registered accounts. * * @param accountName Account name * @param to Recipient email(s) * @param templateId Template ID * @param templateData Template placeholders values * @param options.from Sender email * @param options.attachments Attachments to be included in the email */ sendTemplatedEmail(accountName: string, to: string[], templateId: string, templateData: JSONObject, { from, attachments, }?: { from?: string; attachments?: SendgridAttachment[]; }): Promise; /** * Adds an account to send email with. * * @param name Account name * @param apiKey Sendgrid API key * @param defaultSender Default sender email address */ addAccount(name: string, apiKey: string, defaultSender: string): void; protected _createAccount(name: any, apiKey: string, defaultSender: string): { name: any; client: MailService; options: { defaultSender: string; }; }; private sendMessage; }