# Unable to customize invalid email domain message

**URL:** https://meta.discourse.org/t/unable-to-customize-invalid-email-domain-message/49134
**Category:** Support
**Created:** [24 Agosto , 2016 05:53 UTC](https://meta.discourse.org/t/unable-to-customize-invalid-email-domain-message/49134 "2016-08-24T05:53:24Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [24 Agosto , 2016 05:53 UTC](https://meta.discourse.org/t/unable-to-customize-invalid-email-domain-message/49134/1 "2016-08-24T05:53:24Z")

</div>

Attempting to customize the text of invalid email domain message. I’ve tried changing every other text block on both the login page and popup, and everything else works. Not sure if this is a bug, or somehow possibly related to a subfolder install (highly doubt it).

 ![](https://global.discourse-cdn.com/meta/original/3X/8/4/84ed125d428f3dd9ce8b84d5a609589eda7844f8.png)  
 ![](https://global.discourse-cdn.com/meta/optimized/3X/2/c/2ca2cc46e517dd447ebf77dabae972238e597af9_2_690x34.png)  
 ![](https://global.discourse-cdn.com/meta/original/3X/2/c/2c1102cbbc41db40bacf2b81f33c484f56753b81.png)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [24 Agosto , 2016 06:00 UTC](https://meta.discourse.org/t/unable-to-customize-invalid-email-domain-message/49134/2 "2016-08-24T06:00:39Z")

</div>

The key is `user.email.not_allowed`

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [24 Agosto , 2016 06:01 UTC](https://meta.discourse.org/t/unable-to-customize-invalid-email-domain-message/49134/3 "2016-08-24T06:01:26Z")

</div>

Right, look at screenshot 1 (zoomed in for screenshot 2) above, I changed that key.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [24 Agosto , 2016 06:38 UTC](https://meta.discourse.org/t/unable-to-customize-invalid-email-domain-message/49134/4 "2016-08-24T06:38:23Z")

</div>

There was something like this with some other text that couldn’t be translated. The problem then was that the `I18n.t` function was being passed a symbol instead of a string. Maybe that’s what is happening here. Doing a search for `user.email.not_allowed` shows that it is being passed as a symbol.

```rb
# email_validator.rb
...
    if record.errors[attribute].blank? && value && ScreenedEmail.should_block?(value)
      record.errors.add(attribute, I18n.t(:'user.email.blocked'))
    end

```

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [24 Agosto , 2016 09:53 UTC](https://meta.discourse.org/t/unable-to-customize-invalid-email-domain-message/49134/5 "2016-08-24T09:53:44Z")

</div>

Just pushed a fix to support both `string` and `symbol` as key for translations 🍌

[https://github.com/discourse/discourse/commit/038eb6f645b55e984fb8c4e3980b1d4aae018d32](https://github.com/discourse/discourse/commit/038eb6f645b55e984fb8c4e3980b1d4aae018d32)

@jomaxro would you mind updating to latest and trying again?

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [24 Agosto , 2016 11:59 UTC](https://meta.discourse.org/t/unable-to-customize-invalid-email-domain-message/49134/6 "2016-08-24T11:59:26Z")

</div>

Updating now…one moment please!

* * *

Thanks @zogstrip, looks good!

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [24 Agosto , 2016 12:45 UTC](https://meta.discourse.org/t/unable-to-customize-invalid-email-domain-message/49134/7 "2016-08-24T12:45:08Z")

</div>


