mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-13 13:55:44 +03:00
Pledge Management: Allow pledge admins to remove the pledge (#123)
* Rename generic "frontend" file to dialog * Add a "remove pledge" action * Process pledge deactivation * Trigger an email on user-initiated pledge deactivation * Show an error when trying to manage a deactivated pledge * Add a label for "deactivated" pledges
This commit is contained in:
parent
619af97bd1
commit
bdbf6d573e
11 changed files with 184 additions and 26 deletions
|
@ -154,3 +154,25 @@ function send_manage_pledge_link( $pledge_id ) {
|
|||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email pledge manager to notify that the pledge has been removed.
|
||||
*
|
||||
* @param WP_Post $pledge The pledge object, used to add the title now that the pledge itself has been deleted.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function send_pledge_deactivation_email( $pledge ) {
|
||||
$message = sprintf(
|
||||
"Your organization, %s, has been removed from the Five for the Future listing.\n\n" .
|
||||
'Please reply to this email if this was a mistake.',
|
||||
$pledge->post_title
|
||||
);
|
||||
|
||||
return send_email(
|
||||
$pledge->{'5ftf_org-pledge-email'},
|
||||
'Pledge removed from Five for the Future',
|
||||
$message,
|
||||
$pledge->ID
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue