File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1+ /* eslint-disable consistent-return */
12import mjml2html from 'mjml' ;
23
3- export default ( template ) => {
4+ /** Parse template string containing mjml tags into html for nodemailer.SendMailOptions.html */
5+ export function renderMjml ( template : string ) : string | undefined {
46 try {
57 const output = mjml2html ( template ) ;
68 return output . html ;
79 } catch ( e ) {
810 console . error ( e ) ;
9- // fall through to null
11+ // fall through to undefined (null is not valid for nodemailer.SendMailOptions.html)
12+ return undefined ;
1013 }
11-
12- return null ;
13- } ;
14+ }
Original file line number Diff line number Diff line change 1- import renderMjml from '../utils/renderMjml' ;
1+ import { renderMjml } from '../utils/renderMjml' ;
22import { mailLayout } from './mailLayout' ;
33import { consolidationMailLayout } from './consolidationMailLayout' ;
44
You can’t perform that action at this time.
0 commit comments