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


PHP Contacts::getPortalEmailContents方法代码示例

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


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

示例1: Contacts_sendCustomerPortalLoginDetails

function Contacts_sendCustomerPortalLoginDetails($entityData)
{
    $adb = PearDatabase::getInstance();
    $moduleName = $entityData->getModuleName();
    $wsId = $entityData->getId();
    $parts = explode('x', $wsId);
    $entityId = $parts[1];
    $email = $entityData->get('email');
    if ($entityData->get('portal') == 'on' || $entityData->get('portal') == '1') {
        $sql = "SELECT id, user_name, user_password, isactive FROM vtiger_portalinfo WHERE id=?";
        $result = $adb->pquery($sql, array($entityId));
        $insert = false;
        if ($adb->num_rows($result) == 0) {
            $insert = true;
        } else {
            $dbusername = $adb->query_result($result, 0, 'user_name');
            $isactive = $adb->query_result($result, 0, 'isactive');
            if ($email == $dbusername && $isactive == 1 && !$entityData->isNew()) {
                $update = false;
            } else {
                if ($entityData->get('portal') == 'on' || $entityData->get('portal') == '1') {
                    $sql = "UPDATE vtiger_portalinfo SET user_name=?, isactive=1 WHERE id=?";
                    $adb->pquery($sql, array($email, $entityId));
                    $password = $adb->query_result($result, 0, 'user_password');
                    $update = true;
                } else {
                    $sql = "UPDATE vtiger_portalinfo SET user_name=?, isactive=? WHERE id=?";
                    $adb->pquery($sql, array($email, 0, $entityId));
                    $update = false;
                }
            }
        }
        if ($insert == true) {
            $password = makeRandomPassword();
            $sql = "INSERT INTO vtiger_portalinfo(id,user_name,user_password,type,isactive) VALUES(?,?,?,?,?)";
            $params = array($entityId, $email, $password, 'C', 1);
            $adb->pquery($sql, $params);
        }
        if ($insert == true || $update == true) {
            require_once "modules/Emails/mail.php";
            global $current_user;
            $emailData = Contacts::getPortalEmailContents($entityData, $password, 'LoginDetails');
            $subject = $emailData['subject'];
            $contents = $emailData['body'];
            $mail_status = send_mail('Contacts', $entityData->get('email'), $current_user->user_name, "", $subject, $contents);
        }
    } else {
        $sql = "UPDATE vtiger_portalinfo SET user_name=?,isactive=0 WHERE id=?";
        $adb->pquery($sql, array($email, $entityId));
    }
}
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:51,代码来源:ContactsHandler.php

示例2: vtws_sendRecoverPassword

function vtws_sendRecoverPassword($username)
{
    global $adb, $log, $current_user, $PORTAL_URL, $url_code;
    $log->debug("Entering function vtws_sendRecoverPassword");
    $ctors = $adb->query("select contactid,email,user_password\n\t\t\tfrom vtiger_contactdetails\n\t\t\tinner join vtiger_portalinfo on id=contactid\n\t\t\twhere isactive=1 and user_name='{$username}'");
    if (!ctors or $adb->num_rows($ctors) == 0) {
        throw new WebServiceException(WebServiceErrorCode::$INVALIDUSERPWD, "Invalid username: username not found or not active");
    }
    require_once 'modules/Emails/mail.php';
    require_once 'modules/Contacts/Contacts.php';
    $cto = $adb->fetch_array($ctors);
    $password = $cto['user_password'];
    $entityData = VTEntityData::fromEntityId($adb, $cto['contactid']);
    $contents = Contacts::getPortalEmailContents($entityData, $password);
    $subject = getTranslatedString('Customer Portal Login Details', 'Contacts');
    $mail_status = send_mail('Contacts', $cto['email'], $current_user->user_name, "", $subject, $contents);
    $log->debug("Exiting function vtws_sendRecoverPassword");
    return $mail_status;
}
开发者ID:jaimeaga84,项目名称:corebos,代码行数:19,代码来源:CustomerPortalWS.php

示例3: Contacts_sendCustomerPortalLoginDetails

function Contacts_sendCustomerPortalLoginDetails($entityData)
{
    $adb = PearDatabase::getInstance();
    $moduleName = $entityData->getModuleName();
    $wsId = $entityData->getId();
    $parts = explode('x', $wsId);
    $entityId = $parts[1];
    $entityDelta = new VTEntityDelta();
    $portalChanged = $entityDelta->hasChanged($moduleName, $entityId, 'portal');
    $email = $entityData->get('email');
    if ($entityData->get('portal') == 'on' || $entityData->get('portal') == '1') {
        $sql = "SELECT id, user_name, user_password, isactive FROM vtiger_portalinfo WHERE id=?";
        $result = $adb->pquery($sql, array($entityId));
        $insert = false;
        if ($adb->num_rows($result) == 0) {
            $insert = true;
        } else {
            $dbusername = $adb->query_result($result, 0, 'user_name');
            $isactive = $adb->query_result($result, 0, 'isactive');
            if ($email == $dbusername && $isactive == 1 && !$entityData->isNew()) {
                $update = false;
            } else {
                if ($entityData->get('portal') == 'on' || $entityData->get('portal') == '1') {
                    $sql = "UPDATE vtiger_portalinfo SET user_name=?, isactive=? WHERE id=?";
                    $adb->pquery($sql, array($email, 1, $entityId));
                    $update = true;
                } else {
                    $sql = "UPDATE vtiger_portalinfo SET user_name=?, isactive=? WHERE id=?";
                    $adb->pquery($sql, array($email, 0, $entityId));
                    $update = false;
                }
            }
        }
        $password = makeRandomPassword();
        $md5_password = md5($password);
        if ($insert == true) {
            $sql = "INSERT INTO vtiger_portalinfo(id,user_name,user_password,type,isactive) VALUES(?,?,?,?,?)";
            $params = array($entityId, $email, $md5_password, 'C', 1);
            $adb->pquery($sql, $params);
        }
        if ($update == true && $portalChanged == true) {
            $sql = "UPDATE vtiger_portalinfo SET user_password=? WHERE id=?";
            $params = array($md5_password, $entityId);
            $adb->pquery($sql, $params);
        }
        if (($insert == true || ($update = true && $portalChanged == true)) && $entityData->get('emailoptout') == 0) {
            global $current_user, $HELPDESK_SUPPORT_EMAIL_ID, $HELPDESK_SUPPORT_NAME;
            require_once "modules/Emails/mail.php";
            $emailData = Contacts::getPortalEmailContents($entityData, $password, 'LoginDetails');
            $subject = $emailData['subject'];
            if (empty($subject)) {
                $subject = 'Customer Portal Login Details';
            }
            $contents = $emailData['body'];
            $contents = decode_html(getMergedDescription($contents, $entityId, 'Contacts'));
            if (empty($contents)) {
                require_once 'config.inc.php';
                global $PORTAL_URL;
                $contents = 'LoginDetails';
                $contents .= "<br><br> User ID : " . $entityData->get('email');
                $contents .= "<br> Password: " . $password;
                $portalURL = vtranslate('Please ', $moduleName) . '<a href="' . $PORTAL_URL . '" style="font-family:Arial, Helvetica, sans-serif;font-size:13px;">' . vtranslate('click here', $moduleName) . '</a>';
                $contents .= "<br>" . $portalURL;
            }
            $subject = decode_html(getMergedDescription($subject, $entityId, 'Contacts'));
            send_mail('Contacts', $entityData->get('email'), $HELPDESK_SUPPORT_NAME, $HELPDESK_SUPPORT_EMAIL_ID, $subject, $contents, '', '', '', '', '', true);
        }
    } else {
        $sql = "UPDATE vtiger_portalinfo SET user_name=?,isactive=0 WHERE id=?";
        $adb->pquery($sql, array($email, $entityId));
    }
}
开发者ID:lsmonki,项目名称:vtigercrm,代码行数:72,代码来源:ContactsHandler.php


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