mirror of
https://github.com/v2board/v2board.git
synced 2024-11-13 02:59:10 +08:00
update
This commit is contained in:
parent
4b43bd2b9e
commit
eee6351e35
@ -56,7 +56,7 @@ class SendRemindMail extends Command
|
|||||||
'template_value' => [
|
'template_value' => [
|
||||||
'name' => config('v2board.app_name', 'V2Board')
|
'name' => config('v2board.app_name', 'V2Board')
|
||||||
]
|
]
|
||||||
])->delay(10);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ class SendRemindMail extends Command
|
|||||||
'template_value' => [
|
'template_value' => [
|
||||||
'name' => config('v2board.app_name', 'V2Board')
|
'name' => config('v2board.app_name', 'V2Board')
|
||||||
]
|
]
|
||||||
])->delay(10);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ use Illuminate\Foundation\Bus\Dispatchable;
|
|||||||
use Illuminate\Queue\InteractsWithQueue;
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
use Illuminate\Support\Facades\Mail;
|
use Illuminate\Support\Facades\Mail;
|
||||||
|
use App\Models\MailLog;
|
||||||
|
|
||||||
class SendEmail implements ShouldQueue
|
class SendEmail implements ShouldQueue
|
||||||
{
|
{
|
||||||
@ -33,12 +34,23 @@ class SendEmail implements ShouldQueue
|
|||||||
$params = $this->params;
|
$params = $this->params;
|
||||||
$email = $params['email'];
|
$email = $params['email'];
|
||||||
$subject = $params['subject'];
|
$subject = $params['subject'];
|
||||||
Mail::send(
|
try {
|
||||||
$params['template_name'],
|
Mail::send(
|
||||||
$params['template_value'],
|
$params['template_name'],
|
||||||
function ($message) use($email, $subject) {
|
$params['template_value'],
|
||||||
$message->to($email)->subject($subject);
|
function ($message) use($email, $subject) {
|
||||||
}
|
$message->to($email)->subject($subject);
|
||||||
);
|
}
|
||||||
|
);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$error = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
MailLog::create([
|
||||||
|
'email' => $params['email'],
|
||||||
|
'subject' => $params['subject'],
|
||||||
|
'template_name' => $params['template_name'],
|
||||||
|
'error' => isset($error) ? $error : NULL
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user