@perfood/couch-auth
Version:
Easy and secure authentication for CouchDB/Cloudant. Based on SuperLogin, updated and rewritten in Typescript.
19 lines (18 loc) • 780 B
TypeScript
import { Config } from './types/config';
export declare class Mailer {
private config;
private transporter;
constructor(config: Partial<Config>);
/**
* Use the same nodemailer config that couch-auth uses to send out an email.
* Internally, `req` (the sent request), `user` (the sl-user doc) and `data`
* defined in the config are always available.
*
* @param templateId the entry under the `emails` property in the config
* @param recepient the recepient's email address
* @param data additional data directly passed to `nunjucks.render()`. Don't
* add anything called `data` in here!
*/
sendEmail(templateId: string, recepient: string, data?: Record<string, any>): Promise<any>;
private sendMailWithBackoff;
}