Ejemplo n.º 1
0
/**
 * Check for AJAX nonce before processing GoToWebinar integration
 * @return void
 */
function processAjaxGoToWebinar()
{
    check_ajax_referer('op_gtw_nonce', 'nonce');
    processGoToWebinar(op_post('webinar'), op_post('email'));
    wp_send_json_success();
}
Ejemplo n.º 2
0
function op_check_optin_form()
{
    if (isset($_POST['op_optin_form']) && $_POST['op_optin_form'] == 'Y') {
        $message = '';
        $data = unserialize(base64_decode($_POST['op_optin_form_data']));
        foreach ($data['fields'] as $field) {
            $val = isset($_POST[$field['name']]) ? $_POST[$field['name']] : '';
            $message .= $field['text'] . ': ' . $val . "\n";
        }
        $message .= "\n";
        foreach ($data['extra_fields'] as $name => $text) {
            $val = isset($_POST[$name]) ? $_POST[$name] : '';
            $message .= $text . ': ' . $val . "\n";
        }
        $email = op_post('email');
        $webinar = op_post('gotowebinar');
        /*
         * Triggering GoToWebinar
         */
        if (false !== $webinar) {
            processGoToWebinar($webinar, $email);
        }
        wp_mail($data['email_to'], sprintf(__('Optin Form Submission - %s', OP_SN), op_current_url()), $message);
        if ($data['redirect_url'] != '') {
            wp_redirect($data['redirect_url']);
            exit;
        } else {
            $GLOBALS['op_optin_form_sent'] = true;
        }
    }
}