mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-13 13:55:44 +03:00
Move email-related code into the email file
This commit is contained in:
parent
e0e8fae44b
commit
69937c72f5
4 changed files with 118 additions and 118 deletions
|
@ -189,37 +189,12 @@ function create_new_pledge( $name ) {
|
|||
// The pledge's meta data is saved at this point via `save_pledge_meta()`, which is a `save_post` callback.
|
||||
|
||||
if ( ! is_wp_error( $pledge_id ) ) {
|
||||
send_pledge_confirmation_email( $pledge_id, get_post()->ID );
|
||||
Email\send_pledge_confirmation_email( $pledge_id, get_post()->ID );
|
||||
}
|
||||
|
||||
return $pledge_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email pledge manager to confirm their email address.
|
||||
*
|
||||
* @param int $pledge_id The ID of the pledge.
|
||||
* @param int $action_page_id The ID of the page that the user will be taken back to, in order to process their
|
||||
* confirmation request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function send_pledge_confirmation_email( $pledge_id, $action_page_id ) {
|
||||
$pledge = get_post( $pledge_id );
|
||||
|
||||
$message = sprintf(
|
||||
"Thanks for pledging your organization's time to contribute to the WordPress open source project! Please confirm this email address in order to publish your pledge:\n\n%s",
|
||||
Auth\get_authentication_url( $pledge_id, 'confirm_pledge_email', $action_page_id )
|
||||
);
|
||||
|
||||
return Email\send_email(
|
||||
$pledge->{'5ftf_org-pledge-email'},
|
||||
'Please confirm your email address',
|
||||
$message,
|
||||
$pledge_id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter query for archive & search pages to ensure we're only showing the expected data.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue