How do I manually add an email address to the block list?

AI-generated summary

The discussion addresses how to manually add an email address to the block list in the system. Richie initially asks how to do this, noting that while deleting a user allows blocking their email, there’s no direct UI option for manual addition. JammyDodger explains that this isn’t possible via the UI but can be done through the Rails console using the command ScreenedEmail.create(email: "problem@email.com"). Richie confirms this method works on the latest version, providing a console output and a screenshot showing the email appearing in the admin interface after creation.

When deleting a user we have the option to also block the email address from signing up / creating an account again in the future:

The list of email addresses which are blocked can be found at https://example.com/admin/logs/screened_emails

Where / how do I manually add an email address to this list? :thinking:

I don’t think this is possible still using the UI.

There’s this tip for doing it through the rails console, though I haven’t tested it to check it’s up-to-date. Always worth taking a backup first as well when adjusting things in the rails console.

Confirmed working on latest:

[1] pry(main)> **ScreenedEmail**.create(email: **"**problem@email.com**"**)
=> #<ScreenedEmail:0x00007f74b3200c90
id: **93**,
email: **"**problem@email.com**"** ,
action_type: **1**,
match_count: **0**,
last_match_at: **nil**,
created_at: **Tue**, **07** **May** **2024** **17**:**01**:**10.150557112** **UTC** **+00**:**00**,
updated_at: **Tue**, **07** **May** **2024** **17**:**01**:**10.150557112** **UTC** **+00**:**00**,
ip_address: **nil**>
[2] pry(main)>

And in the UI:

Thanks @JammyDodger :smiley: