mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-05 10:25:45 +03:00
Contributors: Reset profile hours when pledge deactivated.
See https://github.com/WordPress/five-for-the-future/issues/169
This commit is contained in:
parent
834c62c0d0
commit
c6d7bbb7c1
6 changed files with 338 additions and 4 deletions
|
@ -128,13 +128,23 @@ function send_contributor_confirmation_emails( $pledge_id, $contributor_id = nul
|
|||
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!',
|
||||
$user = get_user_by( 'login', $contributor->post_title );
|
||||
|
||||
$message = sprintf( '
|
||||
Howdy %1$s,
|
||||
|
||||
This email is to notify you that your WordPress.org contributor profile is no longer linked to %2$s’s Five for the Future pledge. If this is unexpected news, it’s best to reach out directly to %2$s with questions.
|
||||
|
||||
If they were the only sponsor linked to your account, then the "Hours Per Week" and "Contributor Teams" fields on your profile have been reset, so that teams have accurate data. If you still plan on contributing without sponsorship, please revisit your profile and enter your new hours and teams.
|
||||
|
||||
https://profiles.wordpress.org/me/profile/edit/group/5/
|
||||
|
||||
Have a great day!',
|
||||
$contributor->post_title,
|
||||
$pledge->post_title
|
||||
);
|
||||
$message = str_replace( "\t", '', trim( $message ) );
|
||||
|
||||
$user = get_user_by( 'login', $contributor->post_title );
|
||||
send_email( $user->user_email, $subject, $message, $pledge_id );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue