I am building a multi-tenant application that shares a single database. The store owner can specify their SMTP or Mailgun settings through the admin panel. Once done, the system is to use these configurations when sending queued emails.
For example, when a customer places an order, the system queues the order confirmation email. The connected store can be queried by calling the $order->store
property of the object. The Store
object has properties that contains SMTP or Mailgun configuration.
So my requirement is to know how these can be used to override the default Mail
configurations of the application on queued jobs. I am already achieving this on normal HTTP calls by using the config
helper class. But jobs are tricky.