Skip to content

Commit fa6f59f

Browse files
committed
Update email promise handling
1 parent e3b50e8 commit fa6f59f

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

libs/email.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,22 @@ module.exports = function (app) {
250250
value: inspection.reason()
251251
});
252252
} else {
253-
done.push({
254-
state: "success",
255-
value: inspection.value()
256-
});
253+
if (Array.isArray(inspection.value())) {
254+
inspection.value().forEach((result) => {
255+
if (result.status === 'ERROR') {
256+
logger.error('FAILED:', result.message);
257+
errors.push({
258+
state: "rejected",
259+
value: result.message
260+
});
261+
}
262+
})
263+
} else {
264+
done.push({
265+
state: "success",
266+
value: inspection.value()
267+
});
268+
}
257269
}
258270
})
259271
.then(function () {

npm-shrinkwrap.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"busboy": "1.4.0",
2727
"cacheman": "2.2.1",
2828
"cacheman-memory": "1.1.0",
29-
"campaign": "git+https://github.com/citizenos/campaign#483d2e84120ee3d1cadd65e23aef16d826433e7d",
30-
"campaign-mailgun": "git+https://github.com/citizenos/campaign-mailgun.git#3eab67996d182ebf1c0cec6ac01fe435234d3994",
29+
"campaign": "git+https://github.com/citizenos/campaign#9904ac1e3628ffa3a49beb87914679c7b61a0e06",
30+
"campaign-mailgun": "git+https://github.com/citizenos/campaign-mailgun.git#14866eace9c2a6af846bacbc13847543a133ba66",
3131
"campaign-mustache": "git+https://github.com/citizenos/campaign-mustache#0e6021098a3104011ced756e6409501cd0651f90",
3232
"campaign-nodemailer": "1.1.0",
3333
"campaign-terminal": "git+https://github.com/citizenos/campaign-terminal#08917254707900cc21486e41bab8780c30e93a24",

0 commit comments

Comments
 (0)