mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-05 18:35:46 +03:00
Manage Pledge: Notify removed contributors (#109)
If a contributor is removed from a pledge, they should be notified of the change. This will send an email to any confirmed contributors letting them know.
This commit is contained in:
parent
b1cbcdb01b
commit
183f7a95bc
2 changed files with 28 additions and 4 deletions
|
@ -115,11 +115,29 @@ function send_contributor_confirmation_emails( $pledge_id, $contributor_id = nul
|
|||
|
||||
"If {$pledge->post_title} isn't sponsoring your contributions, then you can ignore this email, and you won't be listed on their pledge.";
|
||||
|
||||
$user = get_user_by( 'login', $contributor->post_title );
|
||||
send_email( $user->user_email, $subject, $message, $pledge_id );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the removed contributor an email to notify them after removal.
|
||||
*
|
||||
* @param int $pledge_id
|
||||
* @param WP_Post $contributor
|
||||
*/
|
||||
function send_contributor_removed_email( $pledge_id, $contributor ) {
|
||||
$pledge = get_post( $pledge_id );
|
||||
$subject = "Removed from {$pledge->post_title} Five for the Future pledge";
|
||||
$message = "Howdy {$contributor->post_title},\n\n";
|
||||
$message .= sprintf(
|
||||
'This email is to notify you that your WordPress.org contributor profile is no longer linked to %1$s’s Five for the Future pledge. If this is unexpected news, it’s best to reach out directly to %1$s with questions. Have a great day!',
|
||||
$pledge->post_title
|
||||
);
|
||||
|
||||
$user = get_user_by( 'login', $contributor->post_title );
|
||||
send_email( $user->user_email, $subject, $message, $pledge_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Email the pledge admin a temporary link they can use to manage their pledge.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue