Fix transfer recipient emails not sending in production.
Deploy Ladill Transfer / deploy (push) Successful in 48s
Deploy Ladill Transfer / deploy (push) Successful in 48s
Map MAIL_ENCRYPTION to a valid SMTP scheme, send recipient notifications synchronously, document mail/queue env vars, and add a supervisor worker template. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,11 +4,10 @@ namespace App\Notifications;
|
|||||||
|
|
||||||
use App\Models\Transfer;
|
use App\Models\Transfer;
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
||||||
use Illuminate\Notifications\Messages\MailMessage;
|
use Illuminate\Notifications\Messages\MailMessage;
|
||||||
use Illuminate\Notifications\Notification;
|
use Illuminate\Notifications\Notification;
|
||||||
|
|
||||||
class TransferRecipientNotification extends Notification implements ShouldQueue
|
class TransferRecipientNotification extends Notification
|
||||||
{
|
{
|
||||||
use Queueable;
|
use Queueable;
|
||||||
|
|
||||||
|
|||||||
+12
-1
@@ -1,5 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
$mailScheme = strtolower(trim((string) env('MAIL_SCHEME', '')));
|
||||||
|
$mailEncryption = strtolower(trim((string) env('MAIL_ENCRYPTION', '')));
|
||||||
|
|
||||||
|
$smtpScheme = match (true) {
|
||||||
|
in_array($mailScheme, ['smtp', 'smtps'], true) => $mailScheme,
|
||||||
|
$mailScheme !== '' => null,
|
||||||
|
in_array($mailEncryption, ['ssl', 'smtps'], true) => 'smtps',
|
||||||
|
in_array($mailEncryption, ['tls', 'starttls', 'smtp'], true) => 'smtp',
|
||||||
|
default => null,
|
||||||
|
};
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -39,7 +50,7 @@ return [
|
|||||||
|
|
||||||
'smtp' => [
|
'smtp' => [
|
||||||
'transport' => 'smtp',
|
'transport' => 'smtp',
|
||||||
'scheme' => env('MAIL_SCHEME'),
|
'scheme' => $smtpScheme,
|
||||||
'url' => env('MAIL_URL'),
|
'url' => env('MAIL_URL'),
|
||||||
'host' => env('MAIL_HOST', '127.0.0.1'),
|
'host' => env('MAIL_HOST', '127.0.0.1'),
|
||||||
'port' => env('MAIL_PORT', 2525),
|
'port' => env('MAIL_PORT', 2525),
|
||||||
|
|||||||
@@ -28,6 +28,17 @@ SESSION_DRIVER=database
|
|||||||
SESSION_LIFETIME=120
|
SESSION_LIFETIME=120
|
||||||
SESSION_DOMAIN=.ladill.com
|
SESSION_DOMAIN=.ladill.com
|
||||||
|
|
||||||
|
QUEUE_CONNECTION=database
|
||||||
|
|
||||||
|
MAIL_MAILER=smtp
|
||||||
|
MAIL_HOST=mail.ladill.com
|
||||||
|
MAIL_PORT=587
|
||||||
|
MAIL_USERNAME=noreply@ladill.com
|
||||||
|
MAIL_PASSWORD=
|
||||||
|
MAIL_ENCRYPTION=tls
|
||||||
|
MAIL_FROM_ADDRESS=noreply@ladill.com
|
||||||
|
MAIL_FROM_NAME="Ladill Transfer"
|
||||||
|
|
||||||
LADILL_SSO_CLIENT_ID=
|
LADILL_SSO_CLIENT_ID=
|
||||||
LADILL_SSO_CLIENT_SECRET=
|
LADILL_SSO_CLIENT_SECRET=
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
[program:ladill-transfer-worker]
|
||||||
|
process_name=%(program_name)s_%(process_num)02d
|
||||||
|
command=php /var/www/ladill-transfer/current/artisan queue:work database --sleep=3 --tries=3 --timeout=2100 --max-time=3600 --max-jobs=1000
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
stopasgroup=true
|
||||||
|
killasgroup=true
|
||||||
|
user=www-data
|
||||||
|
numprocs=1
|
||||||
|
redirect_stderr=true
|
||||||
|
stdout_logfile=/var/www/ladill-transfer/shared/storage/logs/worker.log
|
||||||
|
stdout_logfile_maxbytes=10MB
|
||||||
|
stdout_logfile_backups=5
|
||||||
|
stopwaitsecs=3600
|
||||||
Reference in New Issue
Block a user