Skip to content

Commit

Permalink
jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Jun 30, 2023
1 parent 09ac3c2 commit 9eab96b
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 44 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ package-lock.json
.nyc_output

.env
.react-email
44 changes: 0 additions & 44 deletions emails/password-reset.tsx

This file was deleted.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
},
"dependencies": {
"@react-email/components": "^0.0.7",
"@react-email/render": "^0.0.7",
"@twurple/api": "^6.0.6",
"@twurple/auth": "^6.0.6",
"ajv": "^8.0.5",
Expand All @@ -39,6 +40,7 @@
"express": "^4.17.1",
"has": "^1.0.3",
"helmet": "^7.0.0",
"htm": "^3.1.1",
"htmlescape": "^1.1.1",
"http-errors": "^2.0.0",
"i18next": "^22.0.2",
Expand Down
48 changes: 48 additions & 0 deletions src/emails/password-reset.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { html } from 'htm/react';
import {
Html,
Head,
Body,
Container,
Button,
Img,
Text,
} from '@react-email/components';

/**
* @param {{ token?: string }} props
*/
export default function PasswordResetEmail({
token = '12c6c577-593a-45d5-861b-4432e4269847',
publicUrl = 'https://wlk.yt',
}) {
const bodyStyle = {
background: '#151515',
color: '#ffffff',
fontFamily: 'Open Sans, sans-serif',
fontSize: 16,
};

return html`
<${Html} lang="en" dir="ltr">
<${Head}>
<title>Password Reset Request</title>
<//>
<${Body} style=${bodyStyle}>
<${Container}>
<${Img} src="https://wlk.yt/static/logo-white-ff06e202.png" alt="" width="400" />
<${Text}>Hello,<//>
<${Text}>Please press this button to reset your password:<//>
<${Button} href="${publicUrl}/reset/${token}">
Reset Password
<//>
<${Text}>Or, if that does not work, copy and paste this link:<//>
<${Text}>${publicUrl}/reset/${token}<//>
<${Text}>Regards,<//>
<//>
<//>
<//>
`;
}

0 comments on commit 9eab96b

Please sign in to comment.