Pledge Form: Encourge group email addresses for perennial access.

Also, clarfy that the field is referring to an address, rather than a piece of email.
This commit is contained in:
Ian Dunn 2019-10-24 07:30:27 -07:00
parent 6b33c4dbd0
commit 33d8ed54b1
No known key found for this signature in database
GPG key ID: 99B971B50343CBCB
2 changed files with 6 additions and 2 deletions

View file

@ -67,6 +67,8 @@ function process_form_new() {
Pledge\CPT_ID
);
// todo make this validation DRY w/ process_form_manage().
if ( has_existing_pledge( $email, 'email' ) ) {
return new WP_Error(
'existing_pledge_email',
@ -74,6 +76,8 @@ function process_form_new() {
);
}
// todo should probably verify that email address is for the same domain as URL. do here and for manage.
$domain = PledgeMeta\get_normalized_domain_from_url( $submission['org-url'] );
if ( has_existing_pledge( $domain, 'domain' ) ) {