mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-07 17:17:23 +08:00
Updated email-templates typings to email-templates v3.5 (#24822)
* updated emailTemplate typings to email-templates 3.5 * Update index.d.ts removed duplicate note
This commit is contained in:
@@ -2,13 +2,20 @@ import EmailTemplates = require('email-templates');
|
||||
|
||||
const email = new EmailTemplates({
|
||||
message: {
|
||||
from: 'Test@tesitng.com'
|
||||
from: 'Test@testing.com'
|
||||
},
|
||||
transport: {
|
||||
jsonTransport: true
|
||||
}}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
const emailNoTransporter = new EmailTemplates({
|
||||
message: {
|
||||
from: 'test@testing.com'
|
||||
},
|
||||
});
|
||||
|
||||
email.juiceResources('<p>bob</p><style>div{color:red;}</style><div/>');
|
||||
email.render('mars/html.pug', {name: 'elon'});
|
||||
email.send({template: 'mars', message: {to: 'elon@spacex.com'}, locals: {name: 'Elon'}});
|
||||
emailNoTransporter.render('mars/html.pug', {name: 'elon'});
|
||||
|
||||
13
types/email-templates/index.d.ts
vendored
13
types/email-templates/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for node-email-templates 3.1
|
||||
// Type definitions for node-email-templates 3.5
|
||||
// Project: https://github.com/niftylettuce/node-email-templates
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
|
||||
// Matus Gura <https://github.com/gurisko>
|
||||
@@ -13,7 +13,7 @@ interface EmailConfig {
|
||||
/**
|
||||
* The nodemailer Transport created via nodemailer.createTransport
|
||||
*/
|
||||
transport: any;
|
||||
transport?: any;
|
||||
/**
|
||||
* The email template directory and engine information
|
||||
*/
|
||||
@@ -34,10 +34,19 @@ interface EmailConfig {
|
||||
* Pass a custom render function if necessary
|
||||
*/
|
||||
render?: { view: string, locals: any };
|
||||
/**
|
||||
* force text-only rendering of template (disregards template folder)
|
||||
*/
|
||||
textOnly?: boolean;
|
||||
/**
|
||||
* <Https://github.com/werk85/node-html-to-text>
|
||||
*/
|
||||
htmlToText?: any;
|
||||
/**
|
||||
* You can pass an option to prefix subject lines with a string
|
||||
* env === 'production' ? false : `[${env.toUpperCase()}] `; // <--- HERE
|
||||
*/
|
||||
subjectPrefix?: any;
|
||||
/**
|
||||
* <https://github.com/Automattic/juice>
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user