diff --git a/src/email-second.js b/src/email-second.js new file mode 100644 index 0000000..5eb7f02 --- /dev/null +++ b/src/email-second.js @@ -0,0 +1,46 @@ +import React from 'react'; +import { readFileSync } from 'fs'; + +import { + Mjml, + MjmlHead, + MjmlTitle, + MjmlPreview, + MjmlBody, + MjmlSection, + MjmlColumn, + MjmlButton, + MjmlImage, + MjmlStyle, + MjmlText +} from 'mjml-react'; + +export const generate = () => { + return ( + + + Last Minute Offer + Last Minute Offer... + + + + + + + + + + + This Yet Another Template + + + + + + Go Back + + + + + ); +}; diff --git a/src/email.js b/src/email.js index 4a8c95c..d0f5e90 100644 --- a/src/email.js +++ b/src/email.js @@ -56,6 +56,11 @@ export const generate = () => { I am red + + + Open Second Template + + ); diff --git a/src/server.js b/src/server.js index b48da3a..c65a9b0 100644 --- a/src/server.js +++ b/src/server.js @@ -1,13 +1,19 @@ import express from 'express'; import {render} from 'mjml-react'; -import {generate} from './email'; +import * as email1 from './email'; +import * as email2 from './email-second'; const port = 3000; const app = express(); +app.get('/2', (req, res) => { + const {html} = render(email2.generate(), {validationLevel: 'soft'}); + res.send(html); +}); + app.get('*', (req, res) => { - const {html} = render(generate(), {validationLevel: 'soft'}); + const {html} = render(email1.generate(), {validationLevel: 'soft'}); res.send(html); });