diff --git a/.env b/.env index ccfee53..d3d9f9b 100644 --- a/.env +++ b/.env @@ -53,7 +53,7 @@ MAILER_DSN=smtp://mailer:1025 # Alternatively, via SMTP (no extra package needed): # MAILER_DSN="smtp://apikey:%env(SENDGRID_API_KEY)%@smtp.sendgrid.net:587?encryption=tls" # Optional default sender (used by test command if --from not passed): -# MAILER_FROM=no-reply@your-domain.tld +MAILER_FROM=noreply@escapepage.dev SENDGRID_API_KEY=your_real_key_goes_here ###< symfony/mailer ### diff --git a/.env.prod b/.env.prod index 6153abc..6b4348d 100644 --- a/.env.prod +++ b/.env.prod @@ -6,6 +6,7 @@ APP_SECRET=a8f89e179e8c338423697669d6728c2c ### Prefer storing SENDGRID_API_KEY using Symfony Secrets or real env vars. ###> symfony/mailer ### MAILER_DSN=sendgrid://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@default +MAILER_FROM=mailer@escapepage.nl ###< symfony/mailer ### ###> symfony/framework-bundle ### diff --git a/config/services.yaml b/config/services.yaml index 5913030..f724eaf 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -4,6 +4,7 @@ # Put parameters here that don't need to change on each machine where the app is deployed # https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration parameters: + mailer_from: '%env(MAILER_FROM)%' services: # default configuration for services in *this* file diff --git a/docker/php/php.ini b/docker/php/php.ini index 78ff47d..228659d 100644 --- a/docker/php/php.ini +++ b/docker/php/php.ini @@ -9,6 +9,6 @@ opcache.validate_timestamps=1 opcache.revalidate_freq=0 log_errors=On -error_log=/var/www/html/var/log/errorlog_php.txt +error_log=/var/www/html/var/log/errorlog_php.log session.gc_maxlifetime=1440 session.cookie_lifetime=0 diff --git a/src/Tech/Controller/RegistrationController.php b/src/Tech/Controller/RegistrationController.php index 6ebf436..7cb2d20 100644 --- a/src/Tech/Controller/RegistrationController.php +++ b/src/Tech/Controller/RegistrationController.php @@ -39,7 +39,7 @@ class RegistrationController extends AbstractController // generate a signed url and email it to the user $emailVerifier->sendEmailConfirmation('app_verify_email', $user, (new TemplatedEmail()) - ->from('noreply@escapepage.dev') + ->from($this->getParameter('mailer_from')) ->to($user->getEmail()) ->subject('Please Confirm your Email') ->htmlTemplate('tech/registration/confirmation_email.html.twig')