🐛 — Use To header for sending mails — Fix #278

This commit is contained in:
Luc Didry 2022-11-17 12:55:02 +01:00
parent 30dc4de99e
commit ad4e942556
No known key found for this signature in database
GPG Key ID: EA868E12D0257E3C
1 changed files with 10 additions and 6 deletions

View File

@ -75,6 +75,8 @@ sub send_mail {
for my $email (@a) {
if (!Email::Valid->address($email)) {
push @bad, $email;
} else {
push @good, $email;
}
}
@ -99,12 +101,14 @@ sub send_mail {
)
}
$c->mail(
from => $c->config('mail_sender'),
bcc => $emails,
subject => $subject,
data => $body
);
for my $email (@good) {
$c->mail(
from => $c->config('mail_sender'),
to => $emails,
subject => $subject,
data => $body
);
}
return $c->render(
template => 'msg',