backend-manager 5.0.95 → 5.0.96

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "5.0.95",
3
+ "version": "5.0.96",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -9,7 +9,7 @@ module.exports = async function ({ before, after, order, uid, userDoc, assistant
9
9
 
10
10
  sendOrderEmail({
11
11
  template: 'main/order/confirmation',
12
- subject: 'Your order is confirmed!',
12
+ subject: `Your order is confirmed! #${order?.id || ''}`,
13
13
  categories: ['order/confirmation'],
14
14
  userDoc,
15
15
  assistant,
@@ -9,7 +9,7 @@ module.exports = async function ({ before, after, order, uid, userDoc, assistant
9
9
 
10
10
  sendOrderEmail({
11
11
  template: 'main/order/cancellation-requested',
12
- subject: 'Your subscription cancellation is confirmed',
12
+ subject: `Your subscription cancellation is confirmed #${order?.id || ''}`,
13
13
  categories: ['order/cancellation-requested'],
14
14
  userDoc,
15
15
  assistant,
@@ -7,12 +7,13 @@ const { sendOrderEmail, formatDate } = require('../send-email.js');
7
7
 
8
8
  module.exports = async function ({ before, after, order, uid, userDoc, assistant }) {
9
9
  const isTrial = after.trial?.claimed === true;
10
+ const brandName = assistant.Manager.config.brand?.name || '';
10
11
 
11
12
  assistant.log(`Transition [subscription/new-subscription]: uid=${uid}, product=${after.product?.id}, frequency=${after.payment?.frequency}, trial=${isTrial}`);
12
13
 
13
14
  sendOrderEmail({
14
15
  template: 'main/order/confirmation',
15
- subject: isTrial ? 'Your free trial has started!' : 'Your subscription is confirmed!',
16
+ subject: `Your order from ${brandName} #${order?.id || ''}`,
16
17
  categories: ['order/confirmation'],
17
18
  userDoc,
18
19
  assistant,
@@ -9,7 +9,7 @@ module.exports = async function ({ before, after, order, uid, userDoc, assistant
9
9
 
10
10
  sendOrderEmail({
11
11
  template: 'main/order/payment-failed',
12
- subject: 'Your payment failed',
12
+ subject: `Your payment failed #${order?.id || ''}`,
13
13
  categories: ['order/payment-failed'],
14
14
  userDoc,
15
15
  assistant,
@@ -9,7 +9,7 @@ module.exports = async function ({ before, after, order, uid, userDoc, assistant
9
9
 
10
10
  sendOrderEmail({
11
11
  template: 'main/order/payment-recovered',
12
- subject: 'Your payment was successful',
12
+ subject: `Your payment was successful #${order?.id || ''}`,
13
13
  categories: ['order/payment-recovered'],
14
14
  userDoc,
15
15
  assistant,
@@ -10,7 +10,7 @@ module.exports = async function ({ before, after, order, uid, userDoc, assistant
10
10
 
11
11
  sendOrderEmail({
12
12
  template: 'main/order/plan-changed',
13
- subject: 'Your subscription plan has been updated',
13
+ subject: `Your subscription plan has been updated #${order?.id || ''}`,
14
14
  categories: ['order/plan-changed'],
15
15
  userDoc,
16
16
  assistant,
@@ -12,7 +12,7 @@ module.exports = async function ({ before, after, order, uid, userDoc, assistant
12
12
 
13
13
  sendOrderEmail({
14
14
  template: 'main/order/cancelled',
15
- subject: 'Your subscription has been cancelled',
15
+ subject: `Your subscription has been cancelled #${order?.id || ''}`,
16
16
  categories: ['order/cancelled'],
17
17
  userDoc,
18
18
  assistant,