Skip to content

Commit

Permalink
Refacor email content and delivery (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
rocktimsaikia authored Dec 25, 2024
1 parent d1193cb commit 2280c88
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 41 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ server/dist
server/data
/.idea
server/test*.[tj]s
server/playground.ts
3 changes: 2 additions & 1 deletion server/src/constants/common.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const EMAIL_ADDRESSES = {
SUPPORT: "[email protected]",
PERSONAL: "[email protected]",
SUPPORT: '"Animechan" <[email protected]>',
};
95 changes: 56 additions & 39 deletions server/src/constants/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,72 +5,89 @@ export const WELCOME_ACTIVATE_EMAIL = (apiKey: string) => `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Thank You for Supporting Animechan!</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
max-width: 600px;
margin: 0 auto;
padding: 20px;
font-family: Arial, sans-serif;
line-height: 1.4;
color: #333;
max-width: 600px;
margin: 0 auto;
}
.container {
text-align: center;
text-align: center;
}
.logo {
width: 150px;
height: auto;
display: block;
max-width: 150px;
margin: 0 auto 20px;
width: 150px;
height: auto;
display: block;
max-width: 150px;
margin: 0 auto 20px;
}
h2 {
color: #4a4a4a;
font-weight: 600;
color: #4a4a4a;
font-weight: 600;
}
p {
font-size: 15px !important;
font-size: 15px !important;
}
.api-key {
background-color: #f4f4f4;
padding: 10px;
border-radius: 5px;
font-family: monospace;
font-size: 14px;
word-break: break-all;
display: inline-block;
background-color: #f4f4f4;
padding: 10px;
border-radius: 5px;
font-family: monospace;
font-size: 14px;
word-break: break-all;
}
.cta-button {
display: inline-block;
background-color: #007bff;
color: white !important;
text-decoration: none;
padding: 10px 20px;
border-radius: 5px;
margin-top: 5px;
display: inline-block;
background-color: #007bff;
color: white !important;
text-decoration: none;
padding: 10px 20px;
border-radius: 5px;
margin-top: 5px;
}
</style>
</head>
<body>
<div class="container">
<img src="https://res.cloudinary.com/animechan/image/upload/v1717068016/assets/5b071025d48339b3baa26dccb0a79e55.png" alt="Animechan Logo" class="logo">
<h1>Thank You for Supporting Animechan!</h1>
<p>We're incredibly grateful for your sponsorship of the Animechan API project. <br />Your contribution is invaluable and helps us continue to improve our service. </p>
<h2>Your API Key</h2>
<img
src="https://res.cloudinary.com/animechan/image/upload/v1717068016/assets/5b071025d48339b3baa26dccb0a79e55.png"
alt="Animechan Logo"
class="logo"
/>
<h1>Welcome to Animechan Premium 🎉</h1>
<p>
Thank you for joining as a premium member of the Animechan API
project.<br />Your support helps keep Animechan alive and
delivering a great experience for all.
</p>
<h2>Your Exclusive API Key:</h2>
<p class="api-key">${apiKey}</p>
<p>You now also have access to our private Discord server for premium members.</p>
<a href="${process.env.PRIVATE_DISCORD_URL}" class="cta-button">Join Our Discord</a>
<h2>Getting Started</h2>
<p>Ready to dive in? Check out our <a href="https://animechan.io/docs/" target="_blank">API documentation</a> to make authenticated requests. <br /> If you have any questions or need assistance, don't hesitate to reach out to us at <a href="mailto:[email protected]">[email protected]</a> or our private discord server. </p>
<p>Thank you again for your support!</p>
<p>
Check out our <a href="https://animechan.io/docs/" target="_blank">documentation</a>
on how to make authenticated requests.<br />
For any questions or assistance, please reach out to us at
<a href="mailto:[email protected]">[email protected]</a> or our
discord server. <br/><br/>
Thank you once again for your support.<br/>
Animechan Team.
<a href="https://animechan.io" target="_blank">www.animechan.io</a>
</p>
</div>
</body>
</html>
Expand Down
2 changes: 1 addition & 1 deletion server/src/routes/bmac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ router.post("/bmac", async (req, res) => {
if (isProduction) {
await sendEmail({
to: supporterEmail,
subject: "Thank you for your support | Animechan.io",
subject: "Welcome to Animechan Premium | Animechan.io",
content: WELCOME_ACTIVATE_EMAIL(apiKey.key),
});
console.log("Created user and API key:", user, apiKey);
Expand Down

0 comments on commit 2280c88

Please sign in to comment.