Selaa lähdekoodia

メール送信のBCC対応

master
sosuke.iwabuchi 1 vuosi sitten
vanhempi
commit
38cfd4412d
2 muutettua tiedostoa jossa 9 lisäystä ja 2 poistoa
  1. +7
    -2
      app/Email/Sender.php
  2. +2
    -0
      config/mail.php

+ 7
- 2
app/Email/Sender.php Näytä tiedosto

@@ -21,9 +21,14 @@ class Sender
'mailer' => $email->type,
]);

$bcc = config('mail.bcc_targets', []);

try {
Mail::to($email->email)
->send(new TextEmail($email->subject, $email->content, $email->emailAttachments));
$send = Mail::to($email->email);
if (0 < count($bcc)) {
$send = $send->bcc($bcc);
}
$send->send(new TextEmail($email->subject, $email->content, $email->emailAttachments));
} catch (Exception $e) {
Log::error("メール送信失敗", [
'id' => $email->id,


+ 2
- 0
config/mail.php Näytä tiedosto

@@ -125,4 +125,6 @@ return [

'developmentEmail' => env('MAIL_ADDRESS_DEVELOPMENT'),

'bcc_targets' => explode(",", env('MAIL_BCC_TARGETS', '')),

];

Loading…
Peruuta
Tallenna