From f2878d2e9879109a83dc63562d05126489d36cdc Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 6 Dec 2023 22:56:43 -0800 Subject: payment notifications --- lib/payments.js | 10 +++++++++- templates/payments/received.html | 13 +++++-------- templates/payments/verify.html | 6 ------ 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lib/payments.js b/lib/payments.js index 2d0b3330..6ec76650 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -183,7 +183,15 @@ export let credit = async (hash, amount, memo, ref, type = types.internal) => { callWebhook(invoice, p); if (user.verified) { - mail(user, "Payment received", templates.paymentReceived, p); + mail(user, "Payment received", templates.paymentReceived, { + username, + sats: + "⚡️" + + new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 }).format( + p.amount + ), + link: `${process.env.URL}/payment/${p.id}` + }); } mqtt1.publish( diff --git a/templates/payments/received.html b/templates/payments/received.html index 9facb849..e27356c1 100644 --- a/templates/payments/received.html +++ b/templates/payments/received.html @@ -8,20 +8,17 @@ -
- - - -
-
Hello {{username}},
- You received {{amount}} sats! + You received a payment of {{sats}}
-
Cheers,
+
+ {{link}} +
+
Regards,
The Coinos Team
diff --git a/templates/payments/verify.html b/templates/payments/verify.html index 8820f47b..7c0ce31d 100644 --- a/templates/payments/verify.html +++ b/templates/payments/verify.html @@ -8,12 +8,6 @@ -
- - - -
-
Hello {{username}},
-- cgit v1.2.3