Sorry, we don't support your browser.  Install a modern browser
This post is closed.

Accept a callback instead of an array for the email property in config.php#274

Some config settings are sensitive, for instance email.transport.password. It would be better if you could configure them as a callback so you can read the value from a .env file.

3 years ago

I think you can set the password ($mailer->Password = 'secret';) with the beforeSend option just before sending the e-mail.

https://getkirby.com/docs/guide/emails#access-phpmailer-instance

3 years ago

Interesting workaround, will keep this in mind thanks. Does not work for password reset emails though (if I’m correct).

3 years ago

@Philip Why doesn’t work for authentications?

3 years ago

@Philip Maybe this is the answer you’re looking for: The beforeSend callback can also be added as preset in config email option.

3 years ago

@Ahmet Bora Missed that part. Excellent, works perfectly!

3 years ago

@Philip Glad you figured it out. So I’m closing this idea?

3 years ago

@Ahmet Bora I can’t think of another config option that would benefit from this right now so go ahead. I’ll post a new idea if I encounter another case.

3 years ago
1
Changed the status to
Completed
3 years ago