/** * 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_is_approved_status(get_post_status($donation_id))) { return false; } $donation = charitable_get_donation($donation_id); if (!is_object($donation) || 0 == count($donation->get_campaign_donations())) { return false; } if (!apply_filters('charitable_send_' . self::get_email_id(), true, $donation)) { return false; } $email = new Charitable_Email_New_Donation(array('donation' => $donation)); /** * Don't resend the email. */ if ($email->is_sent_already($donation_id)) { return false; } $sent = $email->send(); /** * Log that the email was sent. */ if (apply_filters('charitable_log_email_send', true, self::get_email_id(), $email)) { $email->log($donation_id, $sent); } return true; }
/** * 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_is_approved_status(get_post_status($donation_id))) { return false; } $email = new Charitable_Email_Donation_Receipt(array('donation' => charitable_get_donation($donation_id))); /** * Don't resend the email. */ if ($email->is_sent_already($donation_id)) { return false; } $sent = $email->send(); /** * Log that the email was sent. */ if (apply_filters('charitable_log_email_send', true, self::get_email_id(), $email)) { $email->log($donation_id, $sent); } return true; }
/** * Returns whether the passed status is an confirmed status. * * @return boolean * @access public * @since 1.0.0 * @deprecated 1.4.0 */ public function is_approved_status($status) { charitable_get_deprecated()->deprecated_function(__METHOD__, '1.4.0', 'charitable_is_approved_status'); return charitable_is_approved_status($status); }