Fix admin email processing

When the email is changed, the pledge needs to be set back to pending, until the email is re-confirmed.
This commit is contained in:
Kelly Dwan 2019-11-25 17:11:49 -05:00
parent be84e9dc57
commit 0352c42615
No known key found for this signature in database
GPG key ID: 8BA5575F3D11575D

View file

@ -350,8 +350,15 @@ function update_generated_meta( $meta_id, $object_id, $meta_key, $_meta_value )
update_post_meta( $object_id, META_PREFIX . 'org-domain', $domain );
break;
case META_PREFIX . 'pledge-email':
case META_PREFIX . 'org-pledge-email':
$form_page_id = get_page_by_path( 'for-organizations' )->ID;
Email\send_pledge_confirmation_email( $object_id, $form_page_id );
delete_post_meta( $object_id, META_PREFIX . 'pledge-email-confirmed' );
// Flip pledge back to pending.
wp_update_post( array(
'ID' => $object_id,
'post_status' => 'pending',
) );
break;
}
}