Last active
August 29, 2015 14:14
-
-
Save vodanh1213/3043a5047aa7501450e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('wdf_after_goal_complete', 'fundraiser_done_send_email'); | |
function fundraiser_done_send_email($pledges) | |
{ | |
$small_amount_emails = array(); | |
$large_amount_emails = array(); | |
foreach ($pledges as $pledge) { | |
$data = get_post_meta($pledge->ID, 'wdf_transaction', true); | |
if ($data['gross'] < 5) { | |
$small_amount_emails[] = $data['payer_email']; | |
} else { | |
$large_amount_emails[] = $data['payer_email']; | |
} | |
} | |
//this block for sending small donation amount | |
$small_amount_emails = array_unique($small_amount_emails); | |
$contents = "Chỉ dùng để thử nghiệm"; | |
$subject = "Email thử nghiệm"; | |
foreach ($small_amount_emails as $email) { | |
wp_mail($email, $subject, $contents, array( | |
"Content-type: text/html", | |
"From: My Name <myname@example.com>" | |
)); | |
} | |
//this block for sending larger donation amount | |
$large_amount_emails = array_unique($large_amount_emails); | |
$contents = "Chỉ dùng để thử nghiệm"; | |
$subject = "Email thử nghiệm"; | |
foreach ($large_amount_emails as $email) { | |
wp_mail($email, $subject, $contents, array( | |
"Content-type: text/html", | |
"From: My Name <myname@example.com>" | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment