@easy-cms/plugin-ecommerce 1.40.0 → 1.41.0

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.
@@ -783,7 +783,7 @@ var INFO = {
783
783
  name: "@easy-cms/plugin-ecommerce",
784
784
  // The plugin API it is written for (`PLUGIN_API_VERSION` of @easy-cms/core).
785
785
  apiVersion: 1,
786
- ...true ? { version: "1.40.0" } : {}
786
+ ...true ? { version: "1.41.0" } : {}
787
787
  };
788
788
 
789
789
  // src/shop.ts
@@ -1691,14 +1691,14 @@ function ecommercePlugin(options) {
1691
1691
  });
1692
1692
  const addressCollection = collections.find((c) => c.slug === "addresses");
1693
1693
  const addressRequired = (addressCollection?.fields ?? []).filter((f) => f.required === true && f.name !== "customer").map((f) => f.name);
1694
- const sendOrderEmail = async (cms, write, to, order) => {
1694
+ const sendOrderEmail = async (cms, write, to, order, tag) => {
1695
1695
  if (!write || !cms.config.email) return;
1696
1696
  const currency = currencies.find((c) => c.code === order.currency) ?? currencies[0];
1697
1697
  const locale = order.locale === "th" ? "th" : "en";
1698
1698
  const adapter = methods.get(String(order.paymentMethod));
1699
1699
  const instructions = adapter?.instructions ? labelText(adapter.instructions, locale) : null;
1700
1700
  const content = await write({ order, locale, currency, instructions, cms });
1701
- await cms.sendEmail({ to: typeof to === "string" ? to : [...to], ...content });
1701
+ await cms.sendEmail({ to: typeof to === "string" ? to : [...to], ...content, tag });
1702
1702
  };
1703
1703
  const shop = {
1704
1704
  currencies,
@@ -1721,13 +1721,26 @@ function ecommercePlugin(options) {
1721
1721
  cms,
1722
1722
  emails.orderConfirmation ?? orderConfirmation,
1723
1723
  order.email,
1724
- order
1724
+ order,
1725
+ "order:confirmation"
1725
1726
  );
1726
1727
  if (emails.notify)
1727
- await sendOrderEmail(cms, emails.newOrder ?? newOrder, emails.notify, order);
1728
+ await sendOrderEmail(
1729
+ cms,
1730
+ emails.newOrder ?? newOrder,
1731
+ emails.notify,
1732
+ order,
1733
+ "order:new"
1734
+ );
1728
1735
  }
1729
1736
  if (event === "paid")
1730
- await sendOrderEmail(cms, emails.paymentReceived ?? paymentReceived, order.email, order);
1737
+ await sendOrderEmail(
1738
+ cms,
1739
+ emails.paymentReceived ?? paymentReceived,
1740
+ order.email,
1741
+ order,
1742
+ "order:paid"
1743
+ );
1731
1744
  } catch (error) {
1732
1745
  cms.logger.error(
1733
1746
  `Shop: email for order ${order.orderNumber}: ${error.message}`,
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  paymentSucceeded,
13
13
  price,
14
14
  priceField
15
- } from "./chunk-B6UDZIE5.js";
15
+ } from "./chunk-BTIBQCXY.js";
16
16
 
17
17
  // src/payments.ts
18
18
  var definePaymentAdapter = (adapter) => adapter;
package/dist/stripe.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  paymentFailed,
3
3
  paymentSucceeded
4
- } from "./chunk-B6UDZIE5.js";
4
+ } from "./chunk-BTIBQCXY.js";
5
5
 
6
6
  // src/stripe-client.ts
7
7
  var STRIPE_API_VERSION = "2026-09-30.endive";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/plugin-ecommerce",
3
- "version": "1.40.0",
3
+ "version": "1.41.0",
4
4
  "description": "A shop for Easy CMS: products and variants, prices in several currencies, carts (guests too), checkout with Stripe or bank transfer, orders, stock, customer accounts, and React and Vue hooks (experimental)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -36,7 +36,7 @@
36
36
  "react": ">=18.0.0",
37
37
  "stripe": ">=17.0.0 <24.0.0",
38
38
  "vue": "^3.4.0",
39
- "@easy-cms/core": "^1.40.0"
39
+ "@easy-cms/core": "^1.41.0"
40
40
  },
41
41
  "peerDependenciesMeta": {
42
42
  "react": {
@@ -58,9 +58,9 @@
58
58
  "stripe": "^23.0.0",
59
59
  "stripe-17": "npm:stripe@^17.7.0",
60
60
  "vue": "^3.5.43",
61
- "@easy-cms/core": "^1.40.0",
62
- "@easy-cms/db-sqlite": "^1.40.0",
63
- "@easy-cms/plugin-multi-tenant": "^1.40.0"
61
+ "@easy-cms/core": "^1.41.0",
62
+ "@easy-cms/db-sqlite": "^1.41.0",
63
+ "@easy-cms/plugin-multi-tenant": "^1.41.0"
64
64
  },
65
65
  "engines": {
66
66
  "node": ">=22.12"