External Email Validation
This extension adds a rule to Flarum email validation that will use an external API request to validate the email.
This rule will apply everywhere an email is checked against the UserValidator
including registration and email change requests.
The format of the external API request can be customized to meet a range of needs.
The data is expected to be passed in one of two ways: via query string, or via HTTP body.
The response can be read in one of two ways: a JSON key in the response, or the HTTP status code.
Additionally, an error message can optionally be read from a JSON key in the response.
Otherwise, a default error message can be provided in the extension settings.
To inject the email value inside the URI or Body settings, use one of the following strings in the template:
{{ email | urlencode }}
: This value will be replaced with the email value passed through PHP's urlencode()
method
{{ email | json }}
: This value will be replaced with the email value passed through PHP's json_encode()
. This means the JSON string delimiters will be included!
{{ email | raw }}
: This value will be replaced with the email value without any modification. Don't use this in the URI or JSON payload if you don't know what you're doing.
Installation
composer require clarkwinkelmann/flarum-ext-external-email-validation
Support
This extension is under minimal maintenance.
It was developed for a client and released as open-source for the benefit of the community.
I might publish simple bugfixes or compatibility updates for free.
You can contact me to sponsor additional features or updates.
Support is offered on a "best effort" basis through the Flarum community thread.
Links