修改邮件部分
This commit is contained in:
@@ -16,6 +16,7 @@ class SendEmailJob implements ShouldQueue
|
||||
|
||||
public $tries = 3;
|
||||
public $timeout = 10;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
@@ -34,9 +35,20 @@ class SendEmailJob implements ShouldQueue
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$mailLog = MailService::sendEmail($this->params);
|
||||
$params = $this->params;
|
||||
if (
|
||||
$this->queue === 'send_email_mass'
|
||||
&& isset($params['template_value'])
|
||||
&& is_array($params['template_value'])
|
||||
&& array_key_exists('content', $params['template_value'])
|
||||
) {
|
||||
$timestamp = now()->format('Y-m-d H:i:s.u');
|
||||
$params['template_value']['content'] = (string) $params['template_value']['content'] . "\r\n\r\n[Send-Time: {$timestamp}]";
|
||||
}
|
||||
|
||||
$mailLog = MailService::sendEmail($params);
|
||||
if ($mailLog['error']) {
|
||||
$this->release(); //发送失败将触发重试
|
||||
$this->release(60);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user