Configuration override

Created on 10 February 2025, 2 months ago

Bye,

I successfully installed the module and appreciated the simplicity of its interface.
However, I would like a little help in adopting this module in my projects.

I usually configure an SMTP mail system with user/password/host/port and when I release it in production via environment variables I overwrite user/password/host/port with the real ones.

With this stratagem, locally the mails are sent to a mailhog and in production to an SMTP server such as those of Office 365, for example.
Moreover in the project for security reasons the credentials are not in the git repository available to everyone....

Now I usually do something like this:

$settings[‘symfony_mailer_lite.symfony_mailer_lite_transport.office_365’][‘configuration’][‘pass’] = ‘realpwd’;
$settings[‘symfony_mailer_lite.symfony_mailer_lite_transport.office_365’][‘configuration’][‘host’] = ‘smtp.office365.com’;
$settings[‘symfony_mailer_lite.symfony_mailer_lite_transport.office_365’][‘configuration’][‘port’] = ‘587’;

but the module does not seem to want to accept override...

I have tried a few combinations... to no avail.

My question is therefore: Does the module allow overwrites? If so by which method?

PS: I check the configuration with: drush cget --include-overridden symfony_mailer_lite.symfony_mailer_lite_transport.office_365

💬 Support request
Status

Active

Version

2.0

Component

Documentation

Created by

🇮🇹Italy uccio Turin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @uccio
  • 🇮🇹Italy uccio Turin

    I am pleased to confirm that the module supports overwriting as expected.

    The syntax in settings.php is:

    $config['symfony_mailer_lite.symfony_mailer_lite_transport.office_365']['configuration']['pass'] = 'realpwd';
    $config['symfony_mailer_lite.symfony_mailer_lite_transport.office_365']['configuration']['host'] = 'smtp.office365.com';
    $config['symfony_mailer_lite.symfony_mailer_lite_transport.office_365']['configuration']['port'] = '587';
    

    Sorry to bother you.

  • 🇺🇸United States davemaxg

    I'm trying to do something similar for logging in dev environments only. Can you post your full settings that shows how to direct mails to logging? I assume you also utilize the symfony_mailer_log module for that.

    What does office_365 map to in a yml file? I'm using DSN routing so it seems very different, but I'm trying to piece things together...

    Thank you 🙏

Production build 0.71.5 2024