Skip to content

Support gform_email_field_rejectable_values via UI in Zero Spam #43

@Mwalek

Description

@Mwalek

Gravity Forms recently introduced the gform_email_field_rejectable_values filter, which allows developers to define a list of disallowed/rejectable email addresses or domains for email fields.

It would be beneficial to add UI support for this functionality in the Zero Spam plugin so that site admins can manage rejectable email values without needing to write custom PHP code.

Potential Implementations

================================================================================
Variant A — Simple List (per-form)
================================================================================
| Zero Spam ▸ Email Rejections                                                  |
|-------------------------------------------------------------------------------|
| Enable                                                                        |
| [x] Reject specific email addresses or domains                                |
|                                                                               |
| Instructions                                                                  |
| - Enter one value per line.                                                   |
| - Supports full emails or domains (e.g., bad@site.com or spamdomain.com).     |
| - Wildcards: *.example.com, *@throwaway.tld                                   |
|-------------------------------------------------------------------------------|
| Rejectable Values                                                             |
| | bad@site.com                       | [Remove] |                              |
| | spamdomain.com                     | [Remove] |                              |
| | *.disposablemail.com               | [Remove] |                              |
| |------------------------------------|----------|                              |
| | [ Add new value................................. ] | [+ Add] |               |
|-------------------------------------------------------------------------------|
| Validation Message                                                            |
| [ The email you entered is not allowed. Please use a different address.   ]   |
|-------------------------------------------------------------------------------|
| Scope                                                                         |
| (•) This form only   ( ) All forms                                            |
|-------------------------------------------------------------------------------|
| [ Save Changes ]                                                              |
================================================================================


================================================================================
Variant B — Rule Builder (more explicit, future-proof)
================================================================================
| Zero Spam ▸ Email Rejections                                                  |
|-------------------------------------------------------------------------------|
| Enable                                                                        |
| [x] Turn on email rejection rules                                             |
|-------------------------------------------------------------------------------|
| Rules                                                                         |
| | Type      | Operator    | Value                         | Active | Actions | |
| |-----------|-------------|-------------------------------|--------|---------| |
| | Domain    | equals      | spamdomain.com                |  [x]   | [Edit] |X||
| | Domain    | wildcard    | *.disposablemail.com          |  [x]   | [Edit] |X||
| | Email     | equals      | bad@site.com                  |  [x]   | [Edit] |X||
| | Regex     | matches     | ^temp\+.*@example\.org$       |  [ ]   | [Edit] |X||
|-------------------------------------------------------------------------------|
| + Add Rule                                                                    |
| | Type: [Domain ▼]  Operator: [equals ▼]  Value: [_______________________] | |
| | [ Add ]                                                                     |
|-------------------------------------------------------------------------------|
| Conflict Resolution                                                           |
| (•) Deny if ANY rule matches     ( ) Deny only if ALL rules match             |
|-------------------------------------------------------------------------------|
| Validation Message                                                            |
| [ Sorry, that email address isn’t permitted. Try another email. ]             |
|-------------------------------------------------------------------------------|
| [ Save Changes ]                                                              |
================================================================================


================================================================================
Variant C — Field-Level Override (appears in Email field settings)
================================================================================
| Field Settings ▸ Email                                                        |
|-------------------------------------------------------------------------------|
| Rejectable Values (override form settings)                                    |
| [ ] Enable for this field                                                     |
|                                                                               |
| | one per line…                                                              |
| | spamdomain.com                                                             |
| | bad@site.com                                                               |
| | *.trashmail.io                                                             |
|-------------------------------------------------------------------------------|
| On match:  (•) Block submission   ( ) Warn only (show message, allow submit)  |
| Message:  [ This email is not allowed for this field. ]                       |
|-------------------------------------------------------------------------------|
| [ Save Field ]                                                                |
================================================================================

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions