/** * To help with previewing emails, you can also define a fake value for your field. * * @param array $fields * @param Charitable_Email $email * @return array */ function ed_charitable_preview_extra_donation_field($fields, Charitable_Email $email) { if (!in_array('donation', $email->get_object_types())) { return $fields; } $fields['extra_donation_field'] = 'My Fake Value'; return $fields; }
/** * Instantiate the email class, defining its key values. * * @param mixed[] $objects * @access public * @since 1.0.0 */ public function __construct($objects = array()) { parent::__construct($objects); $this->name = apply_filters('charitable_email_new_donation_name', __('Admin: New Donation Notification', 'charitable')); }
/** * Instantiate the email class, defining its key values. * * @param array $objects * @access public * @since 1.0.0 */ public function __construct($objects = array()) { parent::__construct($objects); $this->name = apply_filters('charitable_email_donation_receipt_name', __('Donation Receipt', 'charitable')); }
/** * Instantiate the email class, defining its key values. * * @param mixed[] $objects * @access public * @since 1.1.0 */ public function __construct($objects = array()) { parent::__construct($objects); $this->name = apply_filters('charitable_email_campaign_end_name', __('Campaign Ended Notification', 'charitable')); }
/** * Display the National ID # in emails. * * This function will only work if you are using Charitable 1.4+. * * Once you have added this snippet, you can display the value in your * email like this: [charitable_email show=national_id_number] * * To adapt this to your needs, you need to pay special attention to the * filter name. In the example below, our filter name is * `charitable_email_content_field_value_national_id_number`. The * `national_id_number` part of this filter name should be whatever you * use in the shortcode for the show parameter. In other words, if this * is your shortcode: * * [charitable_email show=my_amazing_field] * * This would be your filter name: * * charitable_email_content_field_value_my_amazing_field * * Out of convention, we suggest replacing both with the identifier * for your field that you use throughout, which is what we have done * in this example. * * @param string $value * @param array $args * @param Charitable_Email $email * @return string */ function ed_show_national_id_number_in_email($value, $args, Charitable_Email $email) { if ($email->has_valid_donation()) { $value = ed_donation_get_national_id_number($email->get_donation()); } return $value; }
/** * Instantiate the email class, defining its key values. * * @param mixed[] $objects * @access public * @since 1.4.0 */ public function __construct($objects = array()) { parent::__construct($objects); $this->name = apply_filters('charitable_email_password_reset_name', __('User: Password Reset', 'charitable')); $this->user = isset($objects['user']) ? $objects['user'] : false; }
/** * Register email settings fields. * * @param array $settings * @param Charitable_Email $email The email's helper object. * @return array * @access public * @since 1.0.0 */ public function register_email_settings($settings, Charitable_Email $email) { add_filter('charitable_settings_fields_emails_email_' . $email->get_email_id(), array($email, 'add_recipients_field')); return $email->email_settings($settings); }
/** * Checks whether the passed email is the same as the current email object. * * @return boolean * @access protected * @since 1.3.2 */ protected function is_current_email(Charitable_Email $email) { return $email->get_email_id() == $this->get_email_id(); }