diff --git a/consumer/src/EmailController.ts b/consumer/src/EmailController.ts index 51966c6..a107535 100644 --- a/consumer/src/EmailController.ts +++ b/consumer/src/EmailController.ts @@ -15,7 +15,7 @@ export async function checkLimitsForEmail(projectCounts: TUserLimit) { await LimitNotifyModel.create({ user_id, limit1: false, limit2: false, limit3: false }) } - const owner = await UserModel.findById(project.owner); + const owner = await UserModel.findById(user_id); if (!owner) return; const userName = owner.given_name || owner.name || 'no_name'; @@ -25,7 +25,7 @@ export async function checkLimitsForEmail(projectCounts: TUserLimit) { if (hasNotifyEntry.limit3 === true) return; setImmediate(() => { - const emailData = EmailService.getEmailServerInfo('limit_max', { target: owner.email, userName }); + const emailData = EmailService.getEmailServerInfo('limit_max', { target: owner.email }); EmailServiceHelper.sendEmail(emailData); }); @@ -36,7 +36,7 @@ export async function checkLimitsForEmail(projectCounts: TUserLimit) { if (hasNotifyEntry.limit2 === true) return; setImmediate(() => { - const emailData = EmailService.getEmailServerInfo('limit_90', { target: owner.email, userName }); + const emailData = EmailService.getEmailServerInfo('limit_90', { target: owner.email }); EmailServiceHelper.sendEmail(emailData); }); @@ -47,7 +47,7 @@ export async function checkLimitsForEmail(projectCounts: TUserLimit) { if (hasNotifyEntry.limit1 === true) return; setImmediate(() => { - const emailData = EmailService.getEmailServerInfo('limit_50', { target: owner.email, userName }); + const emailData = EmailService.getEmailServerInfo('limit_50', { target: owner.email }); EmailServiceHelper.sendEmail(emailData); }); diff --git a/email/src/services/email.ts b/email/src/services/email.ts index c58beef..9faee2d 100644 --- a/email/src/services/email.ts +++ b/email/src/services/email.ts @@ -62,7 +62,7 @@ export class EmailService { } } - static async sendLimitEmail50(target: string, projectName: string) { + static async sendLimitEmail50(target: string) { try { const sendSmtpEmail = new SendSmtpEmail(); sendSmtpEmail.subject = "⚡ You've reached 50% limit on Litlyx"; @@ -70,7 +70,6 @@ export class EmailService { sendSmtpEmail.to = [{ "email": target }]; sendSmtpEmail.htmlContent = TEMPLATE.LIMIT_50_EMAIL - .replace(/\[Project Name\]/, projectName) .toString(); await this.apiInstance.sendTransacEmail(sendSmtpEmail); @@ -81,14 +80,13 @@ export class EmailService { } } - static async sendLimitEmail90(target: string, projectName: string) { + static async sendLimitEmail90(target: string) { try { const sendSmtpEmail = new SendSmtpEmail(); sendSmtpEmail.subject = "⚡ You've reached 90% limit on Litlyx"; sendSmtpEmail.sender = { "name": "Litlyx", "email": "help@litlyx.com" }; sendSmtpEmail.to = [{ "email": target }]; sendSmtpEmail.htmlContent = TEMPLATE.LIMIT_90_EMAIL - .replace(/\[Project Name\]/, projectName) .toString(); await this.apiInstance.sendTransacEmail(sendSmtpEmail); return true; @@ -98,14 +96,13 @@ export class EmailService { } } - static async sendLimitEmailMax(target: string, projectName: string) { + static async sendLimitEmailMax(target: string) { try { const sendSmtpEmail = new SendSmtpEmail(); sendSmtpEmail.subject = "🚨 You've reached your limit on Litlyx!"; sendSmtpEmail.sender = { "name": "Litlyx", "email": "help@litlyx.com" }; sendSmtpEmail.to = [{ "email": target }]; sendSmtpEmail.htmlContent = TEMPLATE.LIMIT_MAX_EMAIL - .replace(/\[Project Name\]/, projectName) .toString(); await this.apiInstance.sendTransacEmail(sendSmtpEmail); return true; @@ -130,14 +127,13 @@ export class EmailService { } } - static async sendPurchaseEmail(target: string, projectName: string) { + static async sendPurchaseEmail(target: string) { try { const sendSmtpEmail = new SendSmtpEmail(); sendSmtpEmail.subject = "Thank You for Upgrading Your Litlyx Plan!"; sendSmtpEmail.sender = { "name": "Litlyx", "email": "help@litlyx.com" }; sendSmtpEmail.to = [{ "email": target }]; sendSmtpEmail.htmlContent = TEMPLATE.PURCHASE_EMAIL - .replace(/\[Project Name\]/, projectName) .toString(); await this.apiInstance.sendTransacEmail(sendSmtpEmail); return true; diff --git a/email/src/services/server.ts b/email/src/services/server.ts index a42b020..4773cf0 100644 --- a/email/src/services/server.ts +++ b/email/src/services/server.ts @@ -90,10 +90,8 @@ app.post('/send/welcome', express.json(), async (req, res) => { app.post('/send/purchase', express.json(), async (req, res) => { try { - console.log('PURCHASE EMAIL DISABLED') - return; - const { target, projectName } = req.body; - const ok = await EmailService.sendPurchaseEmail(target, projectName); + const { target } = req.body; + const ok = await EmailService.sendPurchaseEmail(target); res.json({ ok }); } catch (ex) { res.status(500).json({ error: ex.message }); @@ -132,8 +130,8 @@ app.post('/send/anomaly/visits_events', express.json(), async (req, res) => { app.post('/send/limit/50', express.json(), async (req, res) => { try { - const { target, projectName } = req.body; - const ok = await EmailService.sendLimitEmail50(target, projectName); + const { target } = req.body; + const ok = await EmailService.sendLimitEmail50(target); res.json({ ok }); } catch (ex) { res.status(500).json({ error: ex.message }); @@ -142,8 +140,8 @@ app.post('/send/limit/50', express.json(), async (req, res) => { app.post('/send/limit/90', express.json(), async (req, res) => { try { - const { target, projectName } = req.body; - const ok = await EmailService.sendLimitEmail90(target, projectName); + const { target } = req.body; + const ok = await EmailService.sendLimitEmail90(target); res.json({ ok }); } catch (ex) { res.status(500).json({ error: ex.message }); @@ -152,8 +150,8 @@ app.post('/send/limit/90', express.json(), async (req, res) => { app.post('/send/limit/max', express.json(), async (req, res) => { try { - const { target, projectName } = req.body; - const ok = await EmailService.sendLimitEmailMax(target, projectName); + const { target } = req.body; + const ok = await EmailService.sendLimitEmailMax(target); res.json({ ok }); } catch (ex) { res.status(500).json({ error: ex.message }); diff --git a/email/templates/ConfirmEmail.ts b/email/templates/ConfirmEmail.ts index 05f9a3b..523f00b 100644 --- a/email/templates/ConfirmEmail.ts +++ b/email/templates/ConfirmEmail.ts @@ -1,5 +1,6 @@ -export const CONFIRM_EMAIL = ` +export const CONFIRM_EMAIL = ` +
@@ -35,7 +36,7 @@ export const CONFIRM_EMAIL = ` .button { display: inline-block; padding: 10px 20px; - background-color: #007bff; + background-color: #0a0a0a; color: #ffffff; text-decoration: none; border-radius: 5px; @@ -61,7 +62,7 @@ export const CONFIRM_EMAIL = `We hope to hear from you soon!
diff --git a/email/templates/Limit50Email.ts b/email/templates/Limit50Email.ts index 496a909..131612d 100644 --- a/email/templates/Limit50Email.ts +++ b/email/templates/Limit50Email.ts @@ -1,14 +1,10 @@ -export const LIMIT_50_EMAIL = ` - +export const LIMIT_50_EMAIL = ` + + - - -- You’ve Reached 50% of Your Litlyx Project Limit on [Project Name] + You’ve Reached 50% of Your Litlyx's Tracking Limits
To avoid losing precious data, please remember to monitor your usage on the Litlyx Dashboard. You can find your current - usage details under Settings > Billing Tab + usage details in your account section.
If you need more data collection storage, you may consider upgrading @@ -65,7 +61,7 @@ export const LIMIT_50_EMAIL = `Have a nice day!
Antonio,
-CEO | Litlyx
+CEO at Litlyx
- 2024 © Litlyx. All rights reserved.
+ 2025 © Litlyx. All rights reserved.
Litlyx S.R.L. - Viale Tirreno, 187 - 00141 Rome - P.IVA:
17814721001- REA: RM-1743194
diff --git a/email/templates/Limit90Email.ts b/email/templates/Limit90Email.ts
index dc53f84..9ab0183 100644
--- a/email/templates/Limit90Email.ts
+++ b/email/templates/Limit90Email.ts
@@ -1,14 +1,10 @@
-export const LIMIT_90_EMAIL = `
-
+export const LIMIT_90_EMAIL = `
+
+
- You’ve Reached 90% of Your Litlyx Project Limit on [Project Name] + You’ve Reached 90% of Your Litlyx's Tracking Limits
To avoid losing precious data, please remember to monitor your usage on the Litlyx Dashboard. You can find your current - usage details under Settings > Billing Tab + usage details in your account section.
If you need more data collection storage, you may consider upgrading @@ -65,7 +61,7 @@ export const LIMIT_90_EMAIL = `Have a nice day!
Antonio,
-CEO | Litlyx
+CEO at Litlyx
- 2024 © Litlyx. All rights reserved.
+ 2025 © Litlyx. All rights reserved.
Litlyx S.R.L. - Viale Tirreno, 187 - 00141 Rome - P.IVA:
17814721001- REA: RM-1743194
@@ -113,5 +109,4 @@ export const LIMIT_90_EMAIL = `
-
`
diff --git a/email/templates/LimitMaxEmail.ts b/email/templates/LimitMaxEmail.ts
index 8d15df3..198c828 100644
--- a/email/templates/LimitMaxEmail.ts
+++ b/email/templates/LimitMaxEmail.ts
@@ -1,14 +1,9 @@
-export const LIMIT_MAX_EMAIL = `
-
+export const LIMIT_MAX_EMAIL = `
+
- You’ve Reached Your Litlyx Project Limit on [Project Name] + You’ve Reached Your Litlyx's Tracking Limits
- We noticed that Litlyx has stopped collecting data for your project. + Litlyx has stopped collecting data for your project.
@@ -62,14 +57,9 @@ export const LIMIT_MAX_EMAIL = ` If you need additional storage for data collection, consider upgrading your plan to unlock more benefits and ensure uninterrupted - service. + service. You can find out more here: Our pricing
-- As a token of appreciation, we're offering you 25% off for life at - checkout with the code LIT25. -
- Thank you for choosing Litlyx as your trusted analytics tool. - +If you have any questions or need assistance, feel free to reply to @@ -82,8 +72,8 @@ export const LIMIT_MAX_EMAIL = `
- Antonio - CEO | Litlyx + Antonio, + CEO at Litlyx
@@ -113,7 +103,7 @@ export const LIMIT_MAX_EMAIL = `
- 2024 © Litlyx. All rights reserved.
+ 2025 © Litlyx. All rights reserved.
Litlyx S.R.L. - Viale Tirreno, 187 - 00141 Rome - P.IVA:
17814721001- REA: RM-1743194
@@ -134,5 +124,4 @@ export const LIMIT_MAX_EMAIL = `
-
`
diff --git a/email/templates/PurchaseEmail.ts b/email/templates/PurchaseEmail.ts
index 6d7da9d..1d726d8 100644
--- a/email/templates/PurchaseEmail.ts
+++ b/email/templates/PurchaseEmail.ts
@@ -1,29 +1,104 @@
-export const PURCHASE_EMAIL = `
-
+export const PURCHASE_EMAIL = `
+
+
+
|
- Dear User, +
We are thrilled to inform you that [Project Name] on Litlyx has successfully been upgraded to a higher plan! Thank you for choosing to elevate your experience with us and for believing in our project. +
+ +
|
+
We’re happy to have you onboard,
- -At Litlyx, we’re committed to creating the best analytics collection experience for everybody, starting from developers.
- -Here are a few things you can do to get started tracking analytics today:
- -If you have any questions or need support, visit docs.litlyx.com.
- -Feel free to reply to this email or reach out to our team at help@litlyx.com. We’re here to help!
- -Link to Discord for developer support: https://discord.com/invite/9cQykjsmWX
- -Thank you for joining us, and we look forward to seeing you around.
- -We want to make analytics the freshest thing on the web.
- -Antonio,
-CEO | Litlyx
- + + +
+
+
+ +
|
+