add_action('charitable_after_save_donation', array('Charitable_Email_New_Donation', 'send_with_donation_id'));
add_action('save_post_' . Charitable::DONATION_POST_TYPE, array('Charitable_Email_New_Donation', 'send_with_donation_id'));
/**
 * Send the Campaign Ended email.
 *
 * This email can be sent to any recipients, within 24 hours after a campaign has reached its end date.
 *
 * @see     Charitable_Email_Campaign_End::send_with_campaign_id()
 */
add_action('charitable_campaign_end', array('Charitable_Email_Campaign_End', 'send_with_campaign_id'));
/**
 * Enable & disable emails.
 *
 * @see     Charitable_Emails::handle_email_settings_request()
 */
add_action('charitable_enable_email', array(Charitable_Emails::get_instance(), 'handle_email_settings_request'));
add_action('charitable_disable_email', array(Charitable_Emails::get_instance(), 'handle_email_settings_request'));
/**
 * Set the current email before sending or previewing an email.
 *
 * @see     Charitable_Emails::set_current_email()
 */
add_action('charitable_before_send_email', array(Charitable_Emails::get_instance(), 'set_current_email'));
add_action('charitable_before_preview_email', array(Charitable_Emails::get_instance(), 'set_current_email'));
/**
 * Register an email's settings.
 *
 * @see     Charitable_Emails::register_email_settings()
 */
add_filter('charitable_settings_fields_emails_email', array(Charitable_Emails::get_instance(), 'register_email_settings'), 10, 2);
 /**
  * Include necessary files.
  *
  * @return  void
  * @access  private
  * @since   1.0.0
  */
 private function load_dependencies()
 {
     $includes_path = $this->get_path('includes');
     /* Abstracts */
     require_once $includes_path . 'abstracts/class-charitable-form.php';
     require_once $includes_path . 'abstracts/class-charitable-query.php';
     require_once $includes_path . 'abstracts/class-charitable-start-object.php';
     /* Functions & Core Classes */
     require_once $includes_path . 'charitable-core-functions.php';
     require_once $includes_path . 'charitable-utility-functions.php';
     require_once $includes_path . 'class-charitable-locations.php';
     require_once $includes_path . 'class-charitable-notices.php';
     require_once $includes_path . 'class-charitable-post-types.php';
     require_once $includes_path . 'class-charitable-request.php';
     require_once $includes_path . 'class-charitable-cron.php';
     require_once $includes_path . 'class-charitable-i18n.php';
     /* Addons */
     require_once $includes_path . 'addons/class-charitable-addons.php';
     /* Campaigns */
     require_once $includes_path . 'campaigns/charitable-campaign-functions.php';
     require_once $includes_path . 'campaigns/class-charitable-campaign.php';
     require_once $includes_path . 'campaigns/class-charitable-campaigns.php';
     require_once $includes_path . 'campaigns/charitable-campaign-hooks.php';
     /* Currency */
     require_once $includes_path . 'currency/charitable-currency-functions.php';
     require_once $includes_path . 'currency/class-charitable-currency.php';
     /* Donations */
     require_once $includes_path . 'donations/abstract-charitable-donation.php';
     require_once $includes_path . 'donations/interface-charitable-donation-form.php';
     require_once $includes_path . 'donations/class-charitable-donation-processor.php';
     require_once $includes_path . 'donations/class-charitable-donation.php';
     require_once $includes_path . 'donations/class-charitable-donation-factory.php';
     require_once $includes_path . 'donations/class-charitable-donations.php';
     require_once $includes_path . 'donations/class-charitable-donations-query.php';
     require_once $includes_path . 'donations/class-charitable-donation-form.php';
     require_once $includes_path . 'donations/class-charitable-donation-amount-form.php';
     require_once $includes_path . 'donations/charitable-donation-hooks.php';
     require_once $includes_path . 'donations/charitable-donation-functions.php';
     /* Users */
     require_once $includes_path . 'users/charitable-user-functions.php';
     require_once $includes_path . 'users/class-charitable-user.php';
     require_once $includes_path . 'users/class-charitable-roles.php';
     require_once $includes_path . 'users/class-charitable-donor.php';
     require_once $includes_path . 'users/class-charitable-donor-query.php';
     /* Gateways */
     require_once $includes_path . 'gateways/interface-charitable-gateway.php';
     require_once $includes_path . 'gateways/class-charitable-gateways.php';
     require_once $includes_path . 'gateways/abstract-class-charitable-gateway.php';
     require_once $includes_path . 'gateways/class-charitable-gateway-offline.php';
     require_once $includes_path . 'gateways/class-charitable-gateway-paypal.php';
     /* Emails */
     require_once $includes_path . 'emails/interface-charitable-email.php';
     require_once $includes_path . 'emails/class-charitable-emails.php';
     require_once $includes_path . 'emails/abstract-class-charitable-email.php';
     require_once $includes_path . 'emails/class-charitable-email-new-donation.php';
     require_once $includes_path . 'emails/class-charitable-email-donation-receipt.php';
     require_once $includes_path . 'emails/class-charitable-email-campaign-end.php';
     require_once $includes_path . 'emails/class-charitable-email-password-reset.php';
     require_once $includes_path . 'emails/charitable-email-hooks.php';
     /* Database */
     require_once $includes_path . 'db/abstract-class-charitable-db.php';
     require_once $includes_path . 'db/class-charitable-campaign-donations-db.php';
     require_once $includes_path . 'db/class-charitable-donors-db.php';
     /* Licensing */
     require_once $includes_path . 'licensing/class-charitable-licenses.php';
     require_once $includes_path . 'licensing/class-charitable-plugin-updater.php';
     /* Public */
     require_once $includes_path . 'public/charitable-page-functions.php';
     require_once $includes_path . 'public/charitable-template-helpers.php';
     require_once $includes_path . 'public/class-charitable-session.php';
     require_once $includes_path . 'public/class-charitable-template.php';
     require_once $includes_path . 'public/class-charitable-template-part.php';
     require_once $includes_path . 'public/class-charitable-templates.php';
     require_once $includes_path . 'public/class-charitable-ghost-page.php';
     require_once $includes_path . 'public/class-charitable-user-dashboard.php';
     /* Shortcodes */
     require_once $includes_path . 'shortcodes/class-charitable-campaigns-shortcode.php';
     require_once $includes_path . 'shortcodes/class-charitable-my-donations-shortcode.php';
     require_once $includes_path . 'shortcodes/class-charitable-donation-receipt-shortcode.php';
     require_once $includes_path . 'shortcodes/class-charitable-login-shortcode.php';
     require_once $includes_path . 'shortcodes/class-charitable-registration-shortcode.php';
     require_once $includes_path . 'shortcodes/class-charitable-profile-shortcode.php';
     require_once $includes_path . 'shortcodes/charitable-shortcodes-hooks.php';
     /* Widgets */
     require_once $includes_path . 'widgets/class-charitable-widgets.php';
     require_once $includes_path . 'widgets/class-charitable-campaign-terms-widget.php';
     require_once $includes_path . 'widgets/class-charitable-campaigns-widget.php';
     require_once $includes_path . 'widgets/class-charitable-donors-widget.php';
     require_once $includes_path . 'widgets/class-charitable-donate-widget.php';
     require_once $includes_path . 'widgets/class-charitable-donation-stats-widget.php';
     /* User Management */
     require_once $includes_path . 'user-management/class-charitable-registration-form.php';
     require_once $includes_path . 'user-management/class-charitable-profile-form.php';
     require_once $includes_path . 'user-management/class-charitable-forgot-password-form.php';
     require_once $includes_path . 'user-management/class-charitable-reset-password-form.php';
     require_once $includes_path . 'user-management/class-charitable-user-management.php';
     require_once $includes_path . 'user-management/charitable-user-management-hooks.php';
     /* Customizer */
     require_once $includes_path . 'admin/customizer/class-charitable-customizer.php';
     /* Deprecated */
     require_once $includes_path . 'deprecated/charitable-deprecated-functions.php';
     /**
      * We are registering this object only for backwards compatibility. It
      * will be removed in or after Charitable 1.3.
      *
      * @deprecated
      */
     $this->register_object(Charitable_Emails::get_instance());
     $this->register_object(Charitable_Request::get_instance());
     $this->register_object(Charitable_Gateways::get_instance());
     $this->register_object(Charitable_i18n::get_instance());
     $this->register_object(Charitable_Post_Types::get_instance());
     $this->register_object(Charitable_Cron::get_instance());
     $this->register_object(Charitable_Widgets::get_instance());
     $this->register_object(Charitable_Licenses::get_instance());
     $this->register_object(Charitable_User_Dashboard::get_instance());
 }