예제 #1
0
* and use this program.                                                    *
*                                                                          *
****************************************************************************
* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/
use Tygh\Mailer;
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    // Add email to maillist
    if ($mode == 'update') {
        if (!empty($_REQUEST['subscribe_email'])) {
            fn_em_subscribe_email($_REQUEST['subscribe_email'], array('name' => fn_em_get_subscriber_name()));
        }
    }
    return array(CONTROLLER_STATUS_REDIRECT);
}
if ($mode == 'unsubscribe') {
    if (!empty($_REQUEST['unsubscribe_key'])) {
        fn_em_unsubscribe($_REQUEST['unsubscribe_key']);
        Registry::get('view')->assign('notification_msg', __('email_marketing.text_unsubscribe_successful'));
        $msg = Registry::get('view')->fetch('addons/email_marketing/common/notification.tpl');
        fn_set_notification('I', __('email_marketing.unsubscribe_successful'), $msg);
    }
    return array(CONTROLLER_STATUS_REDIRECT, fn_url());
} elseif ($mode == 'confirm') {
    if (!empty($_REQUEST['ekey'])) {
        $email = fn_get_object_by_ekey($_REQUEST['ekey'], 'E');
예제 #2
0
*                                                                          *
* This  is  commercial  software,  only  users  who have purchased a valid *
* license  and  accept  to the terms of the  License Agreement can install *
* and use this program.                                                    *
*                                                                          *
****************************************************************************
* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if ($mode == 'customer_info' || $mode == 'update_steps') {
        if (!empty($_SESSION['cart']['user_data']['email'])) {
            $name = fn_em_get_subscriber_name();
            $email = $_SESSION['cart']['user_data']['email'];
            $subscriber_data = fn_em_get_subscriber_data($email);
            if (!empty($subscriber_data) && $subscriber_data['name'] != $name) {
                fn_em_update_subscriber(array('name' => $name), $subscriber_data['subscriber_id']);
            }
        }
    }
    return;
}
if ($mode == 'checkout') {
    if (Registry::get('addons.email_marketing.em_show_on_checkout') == 'Y' && !empty($_SESSION['cart']['user_data']['email']) && !fn_em_is_email_subscribed($_SESSION['cart']['user_data']['email'])) {
        Tygh::$app['view']->assign('show_subscription_checkbox', true);
    }
}
예제 #3
0
<?php

/***************************************************************************
*                                                                          *
*   (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev    *
*                                                                          *
* This  is  commercial  software,  only  users  who have purchased a valid *
* license  and  accept  to the terms of the  License Agreement can install *
* and use this program.                                                    *
*                                                                          *
****************************************************************************
* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    if ($mode == 'place_order') {
        if (!empty($_REQUEST['subscribe_customer'])) {
            fn_em_subscribe_email(Tygh::$app['session']['cart']['user_data']['email'], array('name' => fn_em_get_subscriber_name()));
        }
    }
    return;
}
예제 #4
0
<?php

/***************************************************************************
*                                                                          *
*   (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev    *
*                                                                          *
* This  is  commercial  software,  only  users  who have purchased a valid *
* license  and  accept  to the terms of the  License Agreement can install *
* and use this program.                                                    *
*                                                                          *
****************************************************************************
* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    if ($mode == 'place_order') {
        if (!empty($_REQUEST['subscribe_customer'])) {
            fn_em_subscribe_email($_SESSION['cart']['user_data']['email'], array('name' => fn_em_get_subscriber_name()));
        }
    }
    return;
}