Closed Hanawa02 closed 3 years ago
@aheinze Do you have a plan on when this PR can/will be merged?
Hi 👋 Thank you for your contribution and sorry for the late reply.
I don't like the idea that you can provide the reply-to via a parameter without further checking. For me it is a security concern here. That's why won't merge this PR, sorry.
But I also understand your approach. You can adjust the functionality easily by creating a config/bootstrap.php
file with the following content:
<?php
$app->on('forms.submit.before', function($form, &$data, $frm, &$options) {
if (COCKPIT_API_REQUEST && $this->param('__replyTo') && filter_var($this->param('__replyTo'), FILTER_VALIDATE_EMAIL)) {
$options['reply_to'] = $this->param('__replyTo');
}
});
It is basically binding to the forms.submit.before
event and modifying the mailer options before sending the email.
Hope this helps!
Added the option to set the reply-to mailer option through parameters in the Forms API.
Closes #1453.