当前位置: 首页>>代码示例>>PHP>>正文


PHP WishList::addEmail方法代码示例

本文整理汇总了PHP中WishList::addEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP WishList::addEmail方法的具体用法?PHP WishList::addEmail怎么用?PHP WishList::addEmail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WishList的用法示例。


在下文中一共展示了WishList::addEmail方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dirname

*/
require_once dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../init.php';
require_once dirname(__FILE__) . '/WishList.php';
$context = Context::getContext();
// Instance of module class for translations
$module = new BlockWishList();
if (Configuration::get('PS_TOKEN_ENABLE') == 1 and strcmp(Tools::getToken(false), Tools::getValue('token')) and $context->customer->isLogged() === true) {
    exit($module->l('invalid token', 'sendwishlist'));
}
if ($context->customer->isLogged()) {
    $id_wishlist = (int) Tools::getValue('id_wishlist');
    if (empty($id_wishlist) === true) {
        exit($module->l('Invalid wishlist', 'sendwishlist'));
    }
    for ($i = 1; empty($_POST['email' . strval($i)]) === false; ++$i) {
        $to = Tools::getValue('email' . $i);
        $wishlist = WishList::exists($id_wishlist, $context->customer->id, true);
        if ($wishlist === false) {
            exit($module->l('Invalid wishlist', 'sendwishlist'));
        }
        if (WishList::addEmail($id_wishlist, $to) === false) {
            exit($module->l('Wishlist send error', 'sendwishlist'));
        }
        $toName = strval(Configuration::get('PS_SHOP_NAME'));
        $customer = $context->customer;
        if (Validate::isLoadedObject($customer)) {
            Mail::Send($context->language->id, 'wishlist', sprintf(Mail::l('Message from %1$s %2$s', $context->language->id), $customer->lastname, $customer->firstname), array('{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, '{wishlist}' => $wishlist['name'], '{message}' => Tools::getProtocol() . htmlentities($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8') . __PS_BASE_URI__ . 'modules/blockwishlist/view.php?token=' . $wishlist['token']), $to, $toName, $customer->email, $customer->firstname . ' ' . $customer->lastname, NULL, NULL, dirname(__FILE__) . '/mails/');
        }
    }
}
开发者ID:jicheng17,项目名称:vipinsg,代码行数:31,代码来源:sendwishlist.php


注:本文中的WishList::addEmail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。