/** * Static method that is fired right after a donation is completed, sending the donation receipt. * * @param int $donation_id * @return boolean * @access public * @static * @since 1.0.0 */ public static function send_with_donation_id($donation_id) { if (!charitable_get_helper('emails')->is_enabled_email(self::get_email_id())) { return false; } if (!Charitable_Donation::is_approved_status(get_post_status($donation_id))) { return false; } $email = new Charitable_Email_Donation_Receipt(array('donation' => new Charitable_Donation($donation_id))); $email->send(); return true; }