nodebb-plugin-onekite-calendar 1.0.26 → 1.0.28
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/lib/admin.js +2 -5
- package/lib/api.js +5 -6
- package/lib/helloassoWebhook.js +3 -5
- package/lib/scheduler.js +3 -6
- package/lib/widgets.js +1 -1
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/public/client.js +1 -1
package/lib/admin.js
CHANGED
|
@@ -41,11 +41,8 @@ async function sendEmail(template, uid, subject, data) {
|
|
|
41
41
|
try {
|
|
42
42
|
if (typeof emailer.send !== 'function') return;
|
|
43
43
|
// NodeBB 4.x: send(template, uid, params)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} else {
|
|
47
|
-
await emailer.send(template, toUid);
|
|
48
|
-
}
|
|
44
|
+
// Do NOT branch on function.length (unreliable once wrapped/bound).
|
|
45
|
+
await emailer.send(template, toUid, params);
|
|
49
46
|
} catch (err) {
|
|
50
47
|
console.warn('[calendar-onekite] Failed to send email', {
|
|
51
48
|
template,
|
package/lib/api.js
CHANGED
|
@@ -123,12 +123,11 @@ async function sendEmail(template, uid, subject, data) {
|
|
|
123
123
|
|
|
124
124
|
try {
|
|
125
125
|
if (typeof emailer.send !== 'function') return;
|
|
126
|
-
// NodeBB: send(template, uid, params)
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
126
|
+
// NodeBB 4.x: send(template, uid, params)
|
|
127
|
+
// NOTE: Do NOT branch on function.length: it is unreliable once the function
|
|
128
|
+
// is wrapped/bound (common in production builds) and can lead to params being
|
|
129
|
+
// dropped, resulting in empty email bodies and missing subjects.
|
|
130
|
+
await emailer.send(template, toUid, params);
|
|
132
131
|
} catch (err) {
|
|
133
132
|
// eslint-disable-next-line no-console
|
|
134
133
|
console.warn('[calendar-onekite] Failed to send email', { template, uid: toUid, err: String((err && err.message) || err) });
|
package/lib/helloassoWebhook.js
CHANGED
|
@@ -32,11 +32,9 @@ async function sendEmail(template, uid, subject, data) {
|
|
|
32
32
|
if (typeof emailer.send !== 'function') return;
|
|
33
33
|
const params = Object.assign({}, data || {}, subject ? { subject } : {});
|
|
34
34
|
// NodeBB 4.x: send(template, uid, params)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
await emailer.send(template, toUid);
|
|
39
|
-
}
|
|
35
|
+
// Do NOT branch on function.length: it is unreliable once wrapped/bound and
|
|
36
|
+
// can lead to params being dropped (empty email bodies / missing subjects).
|
|
37
|
+
await emailer.send(template, toUid, params);
|
|
40
38
|
} catch (err) {
|
|
41
39
|
// eslint-disable-next-line no-console
|
|
42
40
|
console.warn('[calendar-onekite] Failed to send email (webhook)', { template, uid: toUid, err: String((err && err.message) || err) });
|
package/lib/scheduler.js
CHANGED
|
@@ -66,12 +66,9 @@ async function processAwaitingPayment() {
|
|
|
66
66
|
|
|
67
67
|
try {
|
|
68
68
|
if (typeof emailer.send !== 'function') return;
|
|
69
|
-
// NodeBB: send(template, uid, params)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
} else {
|
|
73
|
-
await emailer.send(template, toUid);
|
|
74
|
-
}
|
|
69
|
+
// NodeBB 4.x: send(template, uid, params)
|
|
70
|
+
// Do NOT branch on function.length (unreliable once wrapped/bound).
|
|
71
|
+
await emailer.send(template, toUid, params);
|
|
75
72
|
} catch (err) {
|
|
76
73
|
// eslint-disable-next-line no-console
|
|
77
74
|
console.warn('[calendar-onekite] Failed to send email (scheduler)', {
|
package/lib/widgets.js
CHANGED
|
@@ -279,7 +279,7 @@ dateClick: function() { window.location.href = calUrl; },
|
|
|
279
279
|
const title = (ep.itemNameLine || ep.title || ev.title || '').toString();
|
|
280
280
|
const statusLabel = (function(s){
|
|
281
281
|
const map = {
|
|
282
|
-
pending: 'En attente',
|
|
282
|
+
pending: 'En attente de validation',
|
|
283
283
|
awaiting_payment: 'Validée – paiement en attente',
|
|
284
284
|
paid: 'Payée',
|
|
285
285
|
rejected: 'Rejetée',
|
package/package.json
CHANGED
package/plugin.json
CHANGED
package/public/client.js
CHANGED
|
@@ -387,7 +387,7 @@ define('forum/calendar-onekite', ['alerts', 'bootbox', 'hooks'], function (alert
|
|
|
387
387
|
|
|
388
388
|
function statusLabel(s) {
|
|
389
389
|
const map = {
|
|
390
|
-
pending: 'En attente',
|
|
390
|
+
pending: 'En attente de validation',
|
|
391
391
|
awaiting_payment: 'Validée – paiement en attente',
|
|
392
392
|
paid: 'Payée',
|
|
393
393
|
rejected: 'Rejetée',
|