Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for additional parameters in native mailer #470

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nkl-kst
Copy link
Contributor

@nkl-kst nkl-kst commented Oct 31, 2023

This PR adds support for additional parameters to the native mailer, as describe in https://www.php.net/manual/en/function.mail.php

The additional_params parameter can be used to pass additional flags as command line options to the program configured to be used when sending mail, as defined by the sendmail_path configuration setting. For example, this can be used to set the envelope sender address when using sendmail with the -f sendmail option.

In a recent project we had the requirement to set the additional parameter -ftest@example.com to be able to send emails through a relay server. Otherwise the mails were bounced.

The bundle currently allows to set these parameters only on existing logger instances. This PR allows to set them in the configuration file:

native_mailer:
    type: native_mailer
    from_email: 'from@example.com'
    to_email: 'to@example.com'
    subject: 'Example subject'
    parameters:
        - '-ftest@example.com'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant