aboutsummaryrefslogtreecommitdiff
path: root/src/server/ActionUtilities.ts
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2020-01-06 00:37:36 -0800
committerSam Wilkins <samwilkins333@gmail.com>2020-01-06 00:37:36 -0800
commit11000d8959c62772374577fadd9b282c92823a2c (patch)
tree33914410a75e1d492ca1b656b2e1d11afe1b5752 /src/server/ActionUtilities.ts
parentc023583d01fabb44c7aae72b5908ccfcf7fe0c01 (diff)
factored out email, got rid of global regex
Diffstat (limited to 'src/server/ActionUtilities.ts')
-rw-r--r--src/server/ActionUtilities.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/server/ActionUtilities.ts b/src/server/ActionUtilities.ts
index 3125f8683..30aed32e6 100644
--- a/src/server/ActionUtilities.ts
+++ b/src/server/ActionUtilities.ts
@@ -119,7 +119,13 @@ export namespace Email {
});
export async function dispatchAll(recipients: string[], subject: string, content: string) {
- return Promise.all(recipients.map((recipient: string) => Email.dispatch(recipient, subject, content)));
+ const failures: string[] = [];
+ await Promise.all(recipients.map(async (recipient: string) => {
+ if (!await Email.dispatch(recipient, subject, content)) {
+ failures.push(recipient);
+ }
+ }));
+ return failures;
}
export async function dispatch(recipient: string, subject: string, content: string): Promise<boolean> {