Laravel - how to launch emails dynamically by tenant

Viewed 111

I'm making an api in Laravel, where my registered users are segmented by tenant, but when I send the welcome email, each tenent has their own domain. That is, when a user registers with tenant1, I want to welcome them to no-reply@tenat1.com.

But in laravel I put the email information in the .env:

MAIL_DRIVER=smtp
MAIL_Host=mail.propnex.sg
MAIL_PORT=587
MAIL_USERNAME=no-reply@tenant1.com
MAIL_PASSWORD=xxxxxxxx
MAIL_ENCRYPTION=ssl

how do I pass this information that I'm passing in .env, dynamically?

0 Answers
Related