jdavidbakr / mail-tracker

Package for Laravel to inject tracking code into outgoing emails.
MIT License
574 stars 129 forks source link

subdomains are removed on every link in mail with tenant setup #222

Closed adishardiseffectris closed 1 year ago

adishardiseffectris commented 1 year ago

Hi, thanks for a great package!

I'm trying out your package together with https://tenancyforlaravel.com/ on Laravel 10.

Everything works great except when I schedule mails through Laravel scheduler.

When using the scheduler all links in the email gets re-written without the subdomain of the tenant.

The content column show correct links though? Weird!

Any thoughts of what's going on?

Cheers /Adam

adishardiseffectris commented 1 year ago

This issue was caused by and solved by changing tracking - Tracking protocol to https in Mailgun.

adishardiseffectris commented 1 year ago

Disregard the previous comment, I looked att the wrong domain. Issue still persists.

jdavidbakr commented 1 year ago

Are the mails being sent from a queue worker? If so, how does the queue worker know the subdomain? Remember that a queued job by default doesn't know the context of the domain that called it if you are in a multi-tenant/multi-domain environment, and will use whatever is the default in the app config. If your queue worker needs that set you'll need to manually set it in the job itself.

adishardiseffectris commented 1 year ago

Got it thank you!