@ztimson/momentum 0.50.2 → 0.50.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -4
- package/dist/index.mjs +3 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1602,11 +1602,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1602
1602
|
this.api = typeof api == "string" ? new Api(api) : api;
|
|
1603
1603
|
}
|
|
1604
1604
|
send(email) {
|
|
1605
|
-
var _a;
|
|
1606
1605
|
if (!email.to && !email.bcc || !email.body) throw new Error("Cannot send email, missing address or body");
|
|
1607
|
-
return this.api.request({ url: "/api/"
|
|
1608
|
-
var
|
|
1609
|
-
this.emit(PES`email/${(
|
|
1606
|
+
return this.api.request({ url: "/api/email", body: email }).then((response) => {
|
|
1607
|
+
var _a;
|
|
1608
|
+
this.emit(PES`email/${(_a = email.body) == null ? void 0 : _a.template}:c`, { email, response });
|
|
1610
1609
|
return response;
|
|
1611
1610
|
});
|
|
1612
1611
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1598,11 +1598,10 @@ class Email extends PathEventEmitter {
|
|
|
1598
1598
|
this.api = typeof api == "string" ? new Api(api) : api;
|
|
1599
1599
|
}
|
|
1600
1600
|
send(email) {
|
|
1601
|
-
var _a;
|
|
1602
1601
|
if (!email.to && !email.bcc || !email.body) throw new Error("Cannot send email, missing address or body");
|
|
1603
|
-
return this.api.request({ url: "/api/"
|
|
1604
|
-
var
|
|
1605
|
-
this.emit(PES`email/${(
|
|
1602
|
+
return this.api.request({ url: "/api/email", body: email }).then((response) => {
|
|
1603
|
+
var _a;
|
|
1604
|
+
this.emit(PES`email/${(_a = email.body) == null ? void 0 : _a.template}:c`, { email, response });
|
|
1606
1605
|
return response;
|
|
1607
1606
|
});
|
|
1608
1607
|
}
|