diff options
author | Chocobozzz <me@florianbigard.com> | 2019-11-29 13:36:40 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-11-29 13:36:40 +0100 |
commit | 47f6cb31d78f83d5734b11285b11147b0b42e191 (patch) | |
tree | 944b2398272dfe16bae4a47a6738e35e20a6b5cd /server | |
parent | cb5ce4cb13095dbea6e5f05b96eaa42ffccf0716 (diff) | |
download | PeerTube-47f6cb31d78f83d5734b11285b11147b0b42e191.tar.gz PeerTube-47f6cb31d78f83d5734b11285b11147b0b42e191.tar.zst PeerTube-47f6cb31d78f83d5734b11285b11147b0b42e191.zip |
Fix email to field
Diffstat (limited to 'server')
-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) { |