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


PHP Emails::set_emails_user_invitee_relationship方法代码示例

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


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

示例1: track_email

function track_email($user_name, $password, $contact_ids, $date_sent, $email_subject, $email_body)
{
    if (authentication($user_name, $password)) {
        global $current_user;
        global $adb;
        global $log;
        require_once 'modules/Users/Users.php';
        require_once 'modules/Emails/Emails.php';
        $current_user = new Users();
        $user_id = $current_user->retrieve_user_id($user_name);
        $query = "select email1 from vtiger_users where id =?";
        $result = $adb->pquery($query, array($user_id));
        $user_emailid = $adb->query_result($result, 0, "email1");
        $current_user = $current_user->retrieveCurrentUserInfoFromFile($user_id);
        $email = new Emails();
        //$log->debug($msgdtls['contactid']);
        $emailbody = str_replace("'", "''", $email_body);
        $emailsubject = str_replace("'", "''", $email_subject);
        $datesent = substr($date_sent, 1, 10);
        $mydate = date('Y-m-d', $datesent);
        $mydate = getDBInsertDateValue($mydate);
        $email->column_fields[subject] = $emailsubject;
        $email->column_fields[assigned_user_id] = $user_id;
        $email->column_fields[date_start] = $mydate;
        $email->column_fields[description] = $emailbody;
        $email->column_fields[activitytype] = 'Emails';
        $email->plugin_save = true;
        $email->save("Emails");
        $query = "select fieldid from vtiger_field where fieldname = 'email' and tabid = 4 and vtiger_field.presence in (0,2)";
        $result = $adb->pquery($query, array());
        $field_id = $adb->query_result($result, 0, "fieldid");
        $email->set_emails_contact_invitee_relationship($email->id, $contact_ids);
        $email->set_emails_se_invitee_relationship($email->id, $contact_ids);
        $email->set_emails_user_invitee_relationship($email->id, $user_id);
        $sql = "select email from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid where vtiger_crmentity.deleted =0 and vtiger_contactdetails.contactid=?";
        $result = $adb->pquery($sql, array($contact_ids));
        $camodulerow = $adb->fetch_array($result);
        if (isset($camodulerow)) {
            $emailid = $camodulerow["email"];
            //added to save < as $lt; and > as &gt; in the database so as to retrive the emailID
            $user_emailid = str_replace('<', '&lt;', $user_emailid);
            $user_emailid = str_replace('>', '&gt;', $user_emailid);
            $query = 'insert into vtiger_emaildetails values (?,?,?,?,?,?,?,?)';
            $params = array($email->id, $emailid, $user_emailid, "", "", "", $user_id . '@-1|' . $contact_ids . '@' . $field_id . '|', "THUNDERBIRD");
            $adb->pquery($query, $params);
        }
        return $email->id;
    }
}
开发者ID:hardikk,项目名称:HNH,代码行数:49,代码来源:thunderbirdplugin.php

示例2: AddMessageToContact

function AddMessageToContact($username, $session, $contactid, $msgdtls)
{
    if (!validateSession($username, $session)) {
        return null;
    }
    global $current_user;
    global $adb;
    require_once 'modules/Users/Users.php';
    require_once 'modules/Emails/Emails.php';
    $current_user = new Users();
    $user_id = $current_user->retrieve_user_id($username);
    $query = "select email1 from vtiger_users where id = ?";
    $result = $adb->pquery($query, array($user_id));
    $user_emailid = $adb->query_result($result, 0, "email1");
    $current_user = $current_user->retrieveCurrentUserInfoFromFile($user_id);
    foreach ($msgdtls as $msgdtl) {
        if (isset($msgdtl)) {
            $email = new Emails();
            //$log->debug($msgdtls['contactid']);
            $email_body = str_replace("'", "''", $msgdtl['body']);
            $email_body = str_replace('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', " ", $email_body);
            $email_subject = str_replace("'", "''", $msgdtl['subject']);
            $date_sent = getDisplayDate($msgdtl['datesent']);
            $email->column_fields[subject] = $email_subject;
            $email->column_fields[assigned_user_id] = $user_id;
            $email->column_fields[date_start] = $date_sent;
            $email->column_fields[description] = $email_body;
            $email->column_fields[activitytype] = 'Emails';
            $email->column_fields[email_flag] = 'SENT';
            $email->plugin_save = true;
            $email->save("Emails");
            $query = "select fieldid from vtiger_field where fieldname = 'email' and tabid = 4 and vtiger_field.presence in (0,2)";
            $result = $adb->pquery($query, array());
            $field_id = $adb->query_result($result, 0, "fieldid");
            $email->set_emails_contact_invitee_relationship($email->id, $contactid);
            $email->set_emails_se_invitee_relationship($email->id, $contactid);
            $email->set_emails_user_invitee_relationship($email->id, $user_id);
            return $email->id;
        } else {
            return "";
        }
    }
}
开发者ID:hardikk,项目名称:HNH,代码行数:43,代码来源:vtigerolservice.php


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