aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-06 22:56:43 -0800
committerAdam Soltys <[email protected]>2023-12-06 22:56:46 -0800
commitf2878d2e9879109a83dc63562d05126489d36cdc (patch)
treec399ed949ce1e7917667659987dd42354d2a3f7f
parent19b906ec847dbb1f07eeb2d74abd52d195cf6f3e (diff)
downloadcoinos-server-f2878d2e9879109a83dc63562d05126489d36cdc.tar.gz
coinos-server-f2878d2e9879109a83dc63562d05126489d36cdc.zip
payment notifications
-rw-r--r--lib/payments.js10
-rw-r--r--templates/payments/received.html13
-rw-r--r--templates/payments/verify.html6
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 @@
<html>
<body>
- <div style="display: flex; width: 100%;">
- <a href="https://coinos.io" style="margin: auto">
- <img src="https://coinos.io/images/logo.jpg" style="max-width: 800px">
- </a>
- </div>
-
<div style="margin-bottom: 10px">Hello {{username}},</div>
<div style="margin-bottom: 10px">
- You received {{amount}} sats!
+ You received a payment of {{sats}}
</div>
- <div style="margin-bottom: 10px">Cheers,</div>
+ <div style="margin-bottom: 10px">
+ <a href="{{link}}">{{link}}</a>
+ </div>
+ <div>Regards,</div>
<div>The Coinos Team</div>
</body>
</html>
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 @@
<html>
<body>
- <div style="display: flex; width: 100%;">
- <a href="https://coinos.io" style="margin: auto">
- <img src="https://coinos.io/images/logo.jpg">
- </a>
- </div>
-
<div style="margin-bottom: 10px">Hello {{username}},</div>
<div style="margin-bottom: 10px">