Skip to content

Commit

Permalink
issue reproduction
Browse files Browse the repository at this point in the history
  • Loading branch information
curly210102 committed Nov 4, 2021
1 parent 16aaee8 commit e384a10
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 45 deletions.
16 changes: 16 additions & 0 deletions email/template.mjml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<mjml>
<mj-body>
<mj-section>
<mj-column>
<mj-image
width="100px"
src="https://mjml.io/assets/img/logo-small.png"
></mj-image>
<mj-divider border-color="#F45E43"></mj-divider>
<mj-text font-size="20px" color="#F45E43" font-family="helvetica"
>Hello World</mj-text
>
</mj-column>
</mj-section>
</mj-body>
</mjml>
14 changes: 14 additions & 0 deletions pages/api/contact.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { join, resolve } = require("path");
const { readFileSync } = require("fs");

export default async (req, res) => {
const templateDirectory = resolve(process.cwd(), "email");
const emailTemplate = readFileSync(
join(templateDirectory, "template.mjml"),
"utf8"
);

res.status(200).json({
content: emailTemplate,
});
};
40 changes: 0 additions & 40 deletions pages/api/hello.ts

This file was deleted.

7 changes: 2 additions & 5 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"functions": {
"pages/api/hello.ts": {
"includeFiles": "extensions/publish/README.md"
},
"pages/api/hello.js": {
"includeFiles": "extensions/publish/README.md"
"pages/api/contact.js": {
"includeFiles": "email/template.mjml"
}
}
}

0 comments on commit e384a10

Please sign in to comment.