Using the multisite feature, we can differentiate the mail settings across the different sites, which is great:
Now, I’ve set up a schedule in which I loop over users and sends mails in specific cases (membership expiry). Users belong to different subsites and should be mailed using different locales, branding, email settings.
In my Plugin.php file, inside for example registerSchedule(), how can I manually set the multisite context so my user will receive the email from the right sender?
I know we can do something like:
But this is only a part of it. Is there a way to extrapolate from this?