RecipientLocale final class
Minn\Runtime\RecipientLocale · public/minn/src/Minn/Runtime/RecipientLocale.php · 30 lines
An email written in its reader's language, as the reference writes each: the send run inside switch_to_user_locale for the account it goes to (the site's locale when the address belongs to none) and the locale restored after. The facade binds how a switch is made (WP_Locale_Switcher).
Used by 2
Constants and properties
| private | static ?Closure $switcher |
Public
| static | bind(Closure $switcher): void# | How a switch is made (the facade's switch_to_user_locale and restore_previous_locale). |
| static | forUser(int $userId, Closure $send): mixed# | What a send answers, run in a user's language (the site's for 0). |
| static | forAddress(string $email, Closure $send): mixed# | What a send answers, run in the language of the account an address belongs to. |
| static | forSite(Closure $send): mixed# | What a send to the site's address (admin_email) answers, run in its account's language. |
Nothing matches.