コード例 #1
0
ファイル: functions.php プロジェクト: KB-Support/kb-support
/**
 * Email the ticket received confirmation to the admin accounts for testing.
 *
 * @since	1.0
 * @return	void
 */
function kbs_email_test_ticket_received()
{
    $from_name = kbs_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES));
    $from_name = apply_filters('kbs_ticket_from_name', $from_name, 0, array());
    $from_email = kbs_get_option('from_email', get_bloginfo('admin_email'));
    $from_email = apply_filters('kbs_test_ticket_from_address', $from_email, 0, array());
    $subject = kbs_get_option('ticket_subject', __('Purchase Receipt', 'kb-support'));
    $subject = apply_filters('kbs_ticket_subject', wp_strip_all_tags($subject), 0);
    $subject = kbs_do_email_tags($subject, 0);
    $heading = kbs_get_option('purchase_heading', __('Purchase Receipt', 'kb-support'));
    $heading = apply_filters('kbs_ticket_heading', $heading, 0, array());
    $attachments = apply_filters('kbs_ticket_attachments', array(), 0, array());
    $message = kbs_do_email_tags(kbs_get_email_body_content(0, array()), 0);
    $emails = KBS()->emails;
    $emails->__set('from_name', $from_name);
    $emails->__set('from_email', $from_email);
    $emails->__set('heading', $heading);
    $headers = apply_filters('kbs_receipt_headers', $emails->get_headers(), 0, array());
    $emails->__set('headers', $headers);
    $emails->send(kbs_get_admin_notice_emails(), $subject, $message, $attachments);
}
コード例 #2
0
ファイル: template.php プロジェクト: KB-Support/kb-support
/**
 * Displays the email preview
 *
 * @since	0.1
 * @return	void
 */
function kbs_display_email_template_preview()
{
    if (empty($_GET['kbs_action'])) {
        return;
    }
    if ('preview_email' !== $_GET['kbs_action']) {
        return;
    }
    if (!current_user_can('manage_ticket_settings')) {
        return;
    }
    KBS()->emails->heading = sprintf(__('%s Received', 'kb-support'), kbs_get_ticket_label_singular());
    echo KBS()->emails->build_email(kbs_email_preview_template_tags(kbs_get_email_body_content(0, array())));
    exit;
}