diff options
Diffstat (limited to 'server/lib/emailer.ts')
-rw-r--r-- | server/lib/emailer.ts | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts index bd3d4f252..523b11d0d 100644 --- a/server/lib/emailer.ts +++ b/server/lib/emailer.ts | |||
@@ -441,7 +441,7 @@ class Emailer { | |||
441 | return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload }) | 441 | return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload }) |
442 | } | 442 | } |
443 | 443 | ||
444 | sendMail (options: EmailPayload) { | 444 | async sendMail (options: EmailPayload) { |
445 | if (!Emailer.isEnabled()) { | 445 | if (!Emailer.isEnabled()) { |
446 | throw new Error('Cannot send mail because SMTP is not configured.') | 446 | throw new Error('Cannot send mail because SMTP is not configured.') |
447 | } | 447 | } |
@@ -450,13 +450,15 @@ class Emailer { | |||
450 | ? options.fromDisplayName | 450 | ? options.fromDisplayName |
451 | : WEBSERVER.HOST | 451 | : WEBSERVER.HOST |
452 | 452 | ||
453 | return this.transporter.sendMail({ | 453 | for (const to of options.to) { |
454 | from: `"${fromDisplayName}" <${CONFIG.SMTP.FROM_ADDRESS}>`, | 454 | await this.transporter.sendMail({ |
455 | replyTo: options.replyTo, | 455 | from: `"${fromDisplayName}" <${CONFIG.SMTP.FROM_ADDRESS}>`, |
456 | to: options.to.join(','), | 456 | replyTo: options.replyTo, |
457 | subject: options.subject, | 457 | to, |
458 | text: options.text | 458 | subject: options.subject, |
459 | }) | 459 | text: options.text |
460 | }) | ||
461 | } | ||
460 | } | 462 | } |
461 | 463 | ||
462 | private dieOnConnectionFailure (err?: Error) { | 464 | private dieOnConnectionFailure (err?: Error) { |