<p>This issue was discussed a while ago here: <a href="https://github.com/craftcms/cms/issues/3029" rel="nofollow noreferrer">https://github.com/craftcms/cms/issues/3029</a></p>
<p>As Brandon says, Craft basically has no knowledge of which site a user belongs to as they're all global.</p>
<p>Bear in mind that emails that are triggered from the front end will use the domain name where they were triggered from - this problem only really affects emails triggered from the control panel.</p>
<p>The workaround discussed at the bottom there is probably your best bet: use Twig's <code>replace</code> filter to dynamically replace the domain name in the <code>link</code> variable according to what you know about the user (in your case, their preferred language).</p>
<pre><code>{% set link = user.preferredLanguage == 'en' ? link|replace('https://www.site.de','https://www.site.com') : link %}
</code></pre>

CC BY-SA 4.0
2020-09-23T16:23:35.187Z
2020-09-23T16:23:35.187Z
James Smith
<p>we have got a multisite environment and have imported users with different preferred languages (de and en). Therefore we made a module, cause the feedme plugin doens't set the preferred language <a href="https://github.com/craftcms/feed-me/issues/612" rel="nofollow noreferrer">https://github.com/craftcms/feed-me/issues/612</a>. All the users are set to pending. Now we want to sent the activation mails for alle these imported users, so they can set their passwords.</p>
<p>The email is translated cause of the preferred language - thumbs up - but the  with the activation code is just from one domain - in our case the .de domain. This means, all users with a preferred language set to &quot;en&quot; are getting a well translated mail, with a link to the .de page and not the .com for setting their passwords.</p>
<p>So the question is: why is the link not dependent on the preferred language as well or could be localized via a config for this case?</p>

<users><localization><plugin-feedme><registration>
How to configure the system messages <link> url?
# How to configure the system messages <link> url?

(Asked by: username_0 on 2020-09-23)

we have got a multisite environment and have imported users with different preferred languages (de and en). Therefore we made a module, cause the feedme plugin doens't set the preferred language <https://github.com/craftcms/feed-me/issues/612>. All the users are set to pending. Now we want to sent the activation mails for alle these imported users, so they can set their passwords.

The email is translated cause of the preferred language - thumbs up - but the with the activation code is just from one domain - in our case the .de domain. This means, all users with a preferred language set to "en" are getting a well translated mail, with a link to the .de page and not the .com for setting their passwords.

So the question is: why is the link not dependent on the preferred language as well or could be localized via a config for this case?

**Tags:** users, localization, plugin-feedme, registration

---

## 1 answers

### Answer by username_1 on 2020-09-23. Score: 2

This issue was discussed a while ago here: https://github.com/craftcms/cms/issues/3029
As Brandon says, Craft basically has no knowledge of which site a user belongs to as they're all global.
Bear in mind that emails that are triggered from the front end will use the domain name where they were triggered from - this problem only really affects emails triggered from the control panel.
The workaround discussed at the bottom there is probably your best bet: use Twig's replace filter to dynamically replace the domain name in the link variable according to what you know about the user (in your case, their preferred language).
{% set link = user.preferredLanguage == 'en' ? link|replace('https://www.site.de','https://www.site.com') : link %}


---

