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.

25 days 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

25 days ago

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

25 days ago

@Philip Why doesn’t work for authentications?

25 days ago

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

25 days ago

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

25 days ago

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

25 days 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.

25 days ago
1
Changed the status to
Completed
25 days ago