mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-09 23:48:36 +01:00
fix email
This commit is contained in:
@@ -94,7 +94,7 @@ async function onPaymentOnetimeSuccess(event: Event.PaymentIntentSucceededEvent)
|
|||||||
if (!user) return { ok: false, error: 'USER NOT EXIST FOR PROJECT' + project.id }
|
if (!user) return { ok: false, error: 'USER NOT EXIST FOR PROJECT' + project.id }
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
EmailService.sendPurchaseEmail(user.email);
|
EmailService.sendPurchaseEmail(user.email, project.name);
|
||||||
}, 1);
|
}, 1);
|
||||||
|
|
||||||
return { ok: true };
|
return { ok: true };
|
||||||
@@ -139,9 +139,10 @@ async function onPaymentSuccess(event: Event.InvoicePaidEvent) {
|
|||||||
if (!user) return { ok: false, error: 'USER NOT EXIST FOR PROJECT' + project.id }
|
if (!user) return { ok: false, error: 'USER NOT EXIST FOR PROJECT' + project.id }
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
EmailService.sendPurchaseEmail(user.email);
|
if (PLAN.ID == 0) return;
|
||||||
|
EmailService.sendPurchaseEmail(user.email, project.name);
|
||||||
}, 1);
|
}, 1);
|
||||||
|
|
||||||
return { ok: true };
|
return { ok: true };
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -82,13 +82,15 @@ class EmailService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async sendPurchaseEmail(target: string) {
|
async sendPurchaseEmail(target: string, projectName: string) {
|
||||||
try {
|
try {
|
||||||
const sendSmtpEmail = new SendSmtpEmail();
|
const sendSmtpEmail = new SendSmtpEmail();
|
||||||
sendSmtpEmail.subject = "Thank You for Upgrading Your Litlyx Plan!";
|
sendSmtpEmail.subject = "Thank You for Upgrading Your Litlyx Plan!";
|
||||||
sendSmtpEmail.sender = { "name": "Litlyx", "email": "help@litlyx.com" };
|
sendSmtpEmail.sender = { "name": "Litlyx", "email": "help@litlyx.com" };
|
||||||
sendSmtpEmail.to = [{ "email": target }];
|
sendSmtpEmail.to = [{ "email": target }];
|
||||||
sendSmtpEmail.htmlContent = PURCHASE_EMAIL;
|
sendSmtpEmail.htmlContent = PURCHASE_EMAIL
|
||||||
|
.replace(/\[Project Name\]/, projectName)
|
||||||
|
.toString();;
|
||||||
await this.apiInstance.sendTransacEmail(sendSmtpEmail);
|
await this.apiInstance.sendTransacEmail(sendSmtpEmail);
|
||||||
return true;
|
return true;
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
|||||||
Reference in New Issue
Block a user