修改邮件部分

This commit is contained in:
yinjianm
2026-02-22 03:22:14 +08:00
parent 7a3e245887
commit 17a7c63aec
8 changed files with 206 additions and 71 deletions
+14 -2
View File
@@ -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);
}
}
}