@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 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/" + PES`email/${(_a = email.body) == null ? void 0 : _a.template}`, body: email }).then((response) => {
1608
- var _a2;
1609
- this.emit(PES`email/${(_a2 = email.body) == null ? void 0 : _a2.template}:c`, { email, response });
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/" + PES`email/${(_a = email.body) == null ? void 0 : _a.template}`, body: email }).then((response) => {
1604
- var _a2;
1605
- this.emit(PES`email/${(_a2 = email.body) == null ? void 0 : _a2.template}:c`, { email, response });
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztimson/momentum",
3
- "version": "0.50.2",
3
+ "version": "0.50.3",
4
4
  "description": "Client library for momentum",
5
5
  "keywords": ["Momentum"],
6
6
  "author": "Zak Timson <zaktimson@gmail.com>",