From c36d967331f7c9ff747abca4f764227b3290b9ea Mon Sep 17 00:00:00 2001 From: soufiane Date: Wed, 26 Jul 2023 13:28:56 +0200 Subject: [PATCH] wait #6172 mail dynamique --- .env.dev | 1 + .env.production | 1 + .env.staging | 64 +++++++++++++++++++ .../Admin/ProductBaseController.php | 2 +- app/Http/Controllers/AjaxController.php | 1 - config/mail.php | 2 + 6 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 .env.staging diff --git a/.env.dev b/.env.dev index 5bb4442..a9fda08 100644 --- a/.env.dev +++ b/.env.dev @@ -33,6 +33,7 @@ MAIL_PASSWORD=b289d0acb08e0fe56ce98ccf0dd1ed8b MAIL_ENCRYPTION=tls MAIL_FROM_ADDRESS=web@pm-instrumentation.com MAIL_FROM_NAME="PM-Instrumentation" +MAIL_TO_ADDRESS=soufiane@cubedesigners.com PUSHER_APP_ID= PUSHER_APP_KEY= diff --git a/.env.production b/.env.production index 58f2577..1bbecaa 100644 --- a/.env.production +++ b/.env.production @@ -32,6 +32,7 @@ MAIL_PASSWORD=b289d0acb08e0fe56ce98ccf0dd1ed8b MAIL_ENCRYPTION=tls MAIL_FROM_ADDRESS=web@pm-instrumentation.com MAIL_FROM_NAME="PM-Instrumentation" +MAIL_TO_ADDRESS=contact@pm-instrumentation.com PUSHER_APP_ID= PUSHER_APP_KEY= diff --git a/.env.staging b/.env.staging new file mode 100644 index 0000000..0c89144 --- /dev/null +++ b/.env.staging @@ -0,0 +1,64 @@ +APP_NAME=PMI +APP_ENV=production +APP_KEY=base64:/Jmlg7TepI/inQ4KJ3VF0YVTqghRGvvBrnDI7NkUk94= +APP_DEBUG=true +APP_URL=https://staging.pm-instrumentation.com +APP_VARIANTS=PMI,MICHSCI +LOG_CHANNEL=stack + +DB_CONNECTION=mysql +DB_HOST=localhost +DB_PORT=3306 +DB_DATABASE=pmi +DB_USERNAME=pmi +DB_PASSWORD=ZJMcD6nAc3xnLjLVKZ2iWi69 + +BROADCAST_DRIVER=log +CACHE_DRIVER=memcached +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 +SESSION_DOMAIN=.pm-instrumentation.com,.michsci-europe.com + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_DRIVER=smtp +MAIL_HOST=in-v3.mailjet.com +MAIL_PORT=587 +MAIL_USERNAME=ca110b35f8735c223d69c9987c2ac47d +MAIL_PASSWORD=b289d0acb08e0fe56ce98ccf0dd1ed8b +MAIL_ENCRYPTION=tls +MAIL_FROM_ADDRESS=web@pm-instrumentation.com +MAIL_FROM_NAME="PM-Instrumentation" +MAIL_TO_ADDRESS=contact@pm-instrumentation.com + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" + +SEO_ROBOTS=false + +GOOGLE_ANALYTICS_ID=UA-4339912-10 +BACKPACK_LICENSE=YwdOWjeEczPAwy06GzkBJggW + +CUBIST_INTERNAL_SEARCH=true +CUBIST_INTERNAL_SEARCH_INDEX=pmi_production + +ELASTICSEARCH_HOST=127.0.0.1 +ELASTICSEARCH_PORT=9200 +ELASTICSEARCH_SCHEME=http +ELASTICSEARCH_USER= +ELASTICSEARCH_PASS= + +FEATURE_QUOTE=true +FEATURE_NEWS=true +FEATURE_SEARCH=true +FEATURE_I18N=true +FEATURE_TEAM=true +FEATURE_CLIENTS=true diff --git a/app/Http/Controllers/Admin/ProductBaseController.php b/app/Http/Controllers/Admin/ProductBaseController.php index 6babbfd..9d719d0 100644 --- a/app/Http/Controllers/Admin/ProductBaseController.php +++ b/app/Http/Controllers/Admin/ProductBaseController.php @@ -237,7 +237,7 @@ class ProductBaseController extends CubistMagicController { Mail::raw($contents, function ($message) { $message->from(config('mail.from.address'), config('mail.from.name')); $message->sender(config('mail.from.address'), config('mail.from.name')); - $message->to(env('MAIL_TO_ADDRESS')); + $message->to(config('mail.to')); $message->bcc('test+pmi@cubedesigners.com'); $message->subject("[PMI] Import des fiches produits"); }); diff --git a/app/Http/Controllers/AjaxController.php b/app/Http/Controllers/AjaxController.php index 59631ed..1112208 100644 --- a/app/Http/Controllers/AjaxController.php +++ b/app/Http/Controllers/AjaxController.php @@ -126,7 +126,6 @@ class AjaxController extends CubistFrontController $message->from(config('mail.from.address'), config('mail.from.name')); $message->sender(config('mail.from.address'), config('mail.from.name')); $message->bcc('test+pmi@cubedesigners.com'); - $message->to('soufiane@cubedesigners.com'); if($recipient) { $message->to($recipient); } diff --git a/config/mail.php b/config/mail.php index 83dd874..e1efb2e 100644 --- a/config/mail.php +++ b/config/mail.php @@ -60,6 +60,8 @@ return [ 'name' => env('MAIL_FROM_NAME', 'PM-Instrumentation'), ], + 'to' => env('MAIL_TO_ADDRESS'), + /* |-------------------------------------------------------------------------- | E-Mail Encryption Protocol -- 2.39.5