shawnyv
192
2
Laravel

Possible to use multiple mailgun domains?

Posted 2 months ago by shawnyv

Hi all!

I've got an application where I need to use different mail domains for different tasks (IE: task 1 uses "mg.domain1.com" and task2 uses "mg.domain2.com")

Is there an easier way to handle this than wrapping each mailable requirement within code like this:

        $starting_domain = config('services.mailgun.domain');
        config()->set('services.mailgun.domain', 'mg.domain2.com');
        // ...Code here
        config()->set('services.mailgun.domain',$starting_domain);

Thanks for any help!

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.