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:
Jacob
2018-04-09 15:52:41 -04:00
committed by Mohamed Hegazy
parent 5601488fff
commit 25a78f261a
2 changed files with 21 additions and 5 deletions

View File

@@ -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'});

View File

@@ -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>
*/