Skip to content

Commit

Permalink
Print message if no bounces
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhorky committed May 2, 2019
1 parent 2673579 commit 45d9663
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ const mg = mailgun.client({
mg.suppressions
.list(domain, 'bounces')
.then(({ items }) => {
if (items.length < 1) return;
if (items.length < 1) {
console.log('No bounces received, doing nothing.');
return;
}

const message = items.reduce(
({ text, html }, { created_at, code, address, error }) => ({
Expand Down

0 comments on commit 45d9663

Please sign in to comment.