mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-05 10:25:45 +03:00
Organize email & authentication code (#101)
* Split Auth functionality out to new file
* Move email-related code into the email file
* Use `assertFalse` for boolean assertions
* Add `can_manage_pledge` to check user or token against a given pledge
Pulled out of e9763f6678
* Remove duplicate test
This commit is contained in:
parent
03949905c0
commit
f32d26ef47
7 changed files with 360 additions and 274 deletions
|
@ -6,7 +6,7 @@
|
|||
namespace WordPressDotOrg\FiveForTheFuture\PledgeMeta;
|
||||
|
||||
use WordPressDotOrg\FiveForTheFuture;
|
||||
use WordPressDotOrg\FiveForTheFuture\{ Pledge, PledgeForm, Contributor, XProfile };
|
||||
use WordPressDotOrg\FiveForTheFuture\{ Contributor, Email, Pledge, PledgeForm, XProfile };
|
||||
use WP_Post, WP_Error;
|
||||
|
||||
defined( 'WPINC' ) || die();
|
||||
|
@ -274,14 +274,14 @@ function save_pledge( $pledge_id, $pledge ) {
|
|||
save_pledge_meta( $pledge_id, $submitted_meta );
|
||||
|
||||
if ( filter_input( INPUT_POST, 'resend-pledge-confirmation' ) ) {
|
||||
Pledge\send_pledge_confirmation_email(
|
||||
Email\send_pledge_confirmation_email(
|
||||
filter_input( INPUT_GET, 'resend-pledge-id', FILTER_VALIDATE_INT ),
|
||||
get_page_by_path( 'for-organizations' )->ID
|
||||
);
|
||||
}
|
||||
|
||||
if ( filter_input( INPUT_POST, 'resend-contributor-confirmation' ) ) {
|
||||
PledgeForm\send_contributor_confirmation_emails(
|
||||
Email\send_contributor_confirmation_emails(
|
||||
$pledge_id,
|
||||
filter_input( INPUT_GET, 'resend-contributor-id', FILTER_VALIDATE_INT )
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue