-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2973.26cea1d94d325a74bd27.bundle.js
More file actions
42 lines (42 loc) · 1.66 KB
/
2973.26cea1d94d325a74bd27.bundle.js
File metadata and controls
42 lines (42 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"use strict";
(self.webpackChunkmetapress = self.webpackChunkmetapress || []).push([
[2973], {
42973: (e, r, s) => {
s.r(r), s.d(r, {
default: () => i
});
class i {
id = "core.notifier";
name = "Notifier Plugin";
description = "Notifies the admin user that a user entered their world.";
version = "1.0.0";
requires = ["profile"];
provides = [];
onLoad() {
this.sendEmail()
}
async sendEmail() {
if ("1" != metapress.config?.["core.notification.address"]?.enabled || !metapress.config?.["core.notification.address"]?.address) return;
let e = metapress.config?.["core.notification.address"]?.address,
r = metapress.profile?.currentProfile?.fields?.name || "Guest",
s = window.location.href;
await this.sendAPI("https://get.metapress.dev/api/communication/send-entry-notification", {
email: e,
world: s,
user: r,
nonce: this.nonce
})
}
async sendAPI(e, r) {
let s = await fetch(e, {
method: "POST",
body: JSON.stringify(r)
}),
i = await s.json();
if (i.errorText) throw new Error(i.errorText);
return i
}
}
}
}
]);