mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-04 10:05:43 +03:00
Pledge Log: Capture email events.
This commit is contained in:
parent
97daa42308
commit
87eb8ec43a
4 changed files with 46 additions and 5 deletions
|
@ -28,6 +28,7 @@
|
|||
*/
|
||||
|
||||
namespace WordPressDotOrg\FiveForTheFuture\Email;
|
||||
use WordPressDotOrg\FiveForTheFuture;
|
||||
|
||||
defined( 'WPINC' ) || die();
|
||||
|
||||
|
@ -42,17 +43,32 @@ const TOKEN_LENGTH = 32;
|
|||
* @param string $to
|
||||
* @param string $subject
|
||||
* @param string $message
|
||||
* @param int $pledge_id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function send_email( $to, $subject, $message ) {
|
||||
function send_email( $to, $subject, $message, $pledge_id ) {
|
||||
$headers = array(
|
||||
'From: WordPress - Five for the Future <donotreply@wordpress.org>',
|
||||
'Reply-To: support@wordcamp.org',
|
||||
// todo update address when new one is created
|
||||
);
|
||||
|
||||
return wp_mail( $to, $subject, $message, $headers );
|
||||
$result = wp_mail( $to, $subject, $message, $headers );
|
||||
|
||||
/**
|
||||
* Broadcast the results of an attempt to send an email.
|
||||
*
|
||||
* @param string $to
|
||||
* @param string $subject
|
||||
* @param string $message
|
||||
* @param array $headers
|
||||
* @param bool $result
|
||||
* @param int $pledge_id
|
||||
*/
|
||||
do_action( FiveForTheFuture\PREFIX . '_email_result', $to, $subject, $message, $headers, $result, $pledge_id );
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue