Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. function send_admin_notification($funder_id, $trans = false, $fund) {
  2. if($trans != false) {
  3.  
  4. $donor = $trans['first_name'] . ' ' . $trans['last_name'];
  5. $donation_amount = $this->format_currency('',$trans['gross'], 1);
  6. $donor_email = $trans['payer_email'];
  7.  
  8. $recurring = 'One-Time';
  9. if(isset($trans['cycle'])) {
  10. $recurring = $trans['cycle'];
  11. }
  12.  
  13. $to = the_author_meta( 'user_email', $funder_id )
  14. $subject = "Donation Received from " . $donor;
  15. $headers = 'From: "Fundraising" <none@none.none>';
  16. $message = "We have received a new donation from " . $donor . "!\n";
  17. $message .= "Amount: " . $donation_amount . "\n";
  18. $message .= "Fund: " . $fund . "\n";
  19. $message .= "Donor Email: " . $donor_email . "\n";
  20. $message .= "Recurrence: " . $recurring;
  21.  
  22. //send email notification
  23. wp_mail($to, $subject, $message, $headers);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement