public function forgotpassAction() { $oForm = new Form_ForgotPass('/login/forgotpass/'); $bSubmitted = false; if ($this->_request->isPost()) { if ($oForm->isValid($this->_request->getPost())) { $oUser = new Users(); $oPersonalData = $oUser->getPersonalDataFromEmail($this->_request->getPost('email_add')); $oAccountData = $oUser->getAccountDataFromUserId($oPersonalData->id); //generate random password $sNewPassword = substr(md5(rand()), 0, 7); $oUser->updatePasswordData($oAccountData->id, $sNewPassword); //send email for reset $oEmail = new Emails(); $oEmail->mailReset($oPersonalData['email_add'], $oAccountData['username'], $sNewPassword); $bSubmitted = true; } else { $auth = Zend_Auth::getInstance(); $auth->clearIdentity(); $oForm->populate($this->_request->getPost()); } } if (!$bSubmitted) { $this->view->form = $oForm; } else { $this->view->form = "<h1>You have successfully resetted your password. Please check your email.</h1>"; } }
public function pushMail($subject, $message, $address, $priority) { if (isset($address['email']) && isset($address['name'])) { $email = new Emails(); $email->email_subject = $subject; $email->email_body = $message; $email->email_priority = $priority; $email->email_toName = $address['name']; $email->email_toMail = $address['email']; $email->save(false); } else { for ($i = 0; $i < count($address); $i++) { $email = new Emails(); $email->email_subject = $subject; $email->email_body = $message; $email->email_priority = $priority; if (is_array($address[$i])) { $email->email_toName = $address[$i]['name']; $email->email_toMail = $address[$i]['email']; $email->save(false); } else { $email->email_toName = str_replace('"', '', $address[$i]); $email->email_toMail = str_replace('"', '', $address[$i]); $email->save(false); } } } }
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 = DateTimeField::convertToDBFormat($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 > in the database so as to retrive the emailID $user_emailid = str_replace('<', '<', $user_emailid); $user_emailid = str_replace('>', '>', $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; } }
/** * * @return String generated time */ public function actionBackgroundProcess() { $gentime = microtime(); $gentime = explode(' ', $gentime); $gentime = $gentime[1] + $gentime[0]; $pg_start = $gentime; // verify if are emails pending to send $emails = Emails::model()->findAll(array('condition' => 't.email_status = 0', 'limit' => Yii::app()->params['mailSendMultiples'])); if (count($emails) > 0) { foreach ($emails as $email) { Yii::import('application.extensions.phpMailer.yiiPhpMailer'); $mailer = new yiiPhpMailer(); if ($mailer->Ready($email->email_subject, $email->email_body, array('email' => $email->email_toMail, 'name' => $email->email_toName), $email->email_priority)) { $email->email_status = 1; $email->email_sentDate = date("Y-m-d G:i:s"); $email->save(false); } } } $gentime = microtime(); $gentime = explode(' ', $gentime); $gentime = $gentime[1] + $gentime[0]; $pg_end = $gentime; $totaltime = $pg_end - $pg_start; $showtime = number_format($totaltime, 4, '.', ''); echo "Generacion en " . $showtime . " segundos"; }
public function beforeAction($action) { if (!parent::beforeAction($action)) { return false; } if (isset(Yii::app()->user->usIdent)) { // Obtiene la clasificación de los equipos $clasificacion = Clasificacion::model()->with('equipos')->findAll(array('order' => 'posicion ASC')); Yii::app()->setParams(array('clasificacion' => $clasificacion)); // Obtiene la información del usuario $usuario = Usuarios::model()->with('recursos')->findByPK(Yii::app()->user->usIdent); Yii::app()->setParams(array('usuario' => $usuario)); // Obtiene la información de la mensajeria //Saca la lista de los emails recibidos por el usuario y que ademas no los haya leido $mensajeria = Emails::model()->findAllByAttributes(array('id_usuario_to' => Yii::app()->user->usIdent, 'leido' => 0)); $countmens = count($mensajeria); Yii::app()->setParams(array('countmens' => $countmens)); // Obtiene la información de las notificaciones //Saca la lista de las notinicaciones recibidas por el usuario y que ademas no haya leido $notificaciones = Usrnotif::model()->findAllByAttributes(array('usuarios_id_usuario' => Yii::app()->user->usIdent, 'leido' => 0)); $countnot = count($notificaciones); Yii::app()->setParams(array('countnot' => $countnot)); } Yii::app()->setParams(array('bgclass' => 'bg-estadio-fuera')); return true; }
public function get_sms_level() { $smslevel = Emails::getsms_national(); foreach ($smslevel as $levels) { //gets phone number of the record that is to receive consumption sms $phones = $levels['number']; $this->getBalances($phones); } }
public function get_phones($name, $district_or_region, $store) { $smslevel = Emails::getnumber_provincial($district_or_region); foreach ($smslevel as $levels) { //gets phone number of the record $phones = $levels['number']; $this->Send_Message($phones, $name, $store); } }
public function get_phone_number($messsage, $region_name, $district_or_region) { $numer = Emails::getphone_provincial($district_or_region); foreach ($numer as $numers) { //gets phone number of the record $phones = $numers['number']; $this->Send_Balanaces($phones, $messsage, $region_name); //}//end of foreach $smslevel } //end of function send_sms_level }
/** * Create new Email record (and link to given record) including attachments * @global Users $current_user * @global PearDataBase $adb * @param MailManager_Message_Model $mailrecord * @param String $module * @param CRMEntity $linkfocus * @return Integer */ function __CreateNewEmail($mailrecord, $module, $linkfocus) { global $current_user, $adb; if (!$current_user) { $current_user = Users::getActiveAdminUser(); } $handler = vtws_getModuleHandlerFromName('Emails', $current_user); $meta = $handler->getMeta(); if ($meta->hasWriteAccess() != true) { return false; } $focus = new Emails(); $focus->column_fields['activitytype'] = 'Emails'; $focus->column_fields['subject'] = $mailrecord->_subject; if (!empty($module)) { $focus->column_fields['parent_type'] = $module; } if (!empty($linkfocus->id)) { $focus->column_fields['parent_id'] = "{$linkfocus->id}@-1|"; } $focus->column_fields['description'] = $mailrecord->getBodyHTML(); $focus->column_fields['assigned_user_id'] = $current_user->id; $focus->column_fields["date_start"] = date('Y-m-d', $mailrecord->_date); $focus->column_fields["email_flag"] = 'MailManager'; $from = $mailrecord->_from[0]; $to = $mailrecord->_to[0]; $cc = !empty($mailrecord->_cc) ? implode(',', $mailrecord->_cc) : ''; $bcc = !empty($mailrecord->_bcc) ? implode(',', $mailrecord->_bcc) : ''; //emails field were restructured and to,bcc and cc field are JSON arrays $focus->column_fields['from_email'] = $from; $focus->column_fields['saved_toid'] = $to; $focus->column_fields['ccmail'] = $cc; $focus->column_fields['bccmail'] = $bcc; $focus->save('Emails'); $emailid = $focus->id; // TODO: Handle attachments of the mail (inline/file) $this->__SaveAttachements($mailrecord, 'Emails', $focus); return $emailid; }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. */ public function loadUpdateEmail() { if ($this->_model === null) { if (isset($_POST['ContactForm']['email'])) { $condition = "email='" . $_POST['ContactForm']['email'] . "'"; $this->_model = Emails::model()->find($condition); } if ($this->_model === null) { $this->_model = new Emails(); } } return $this->_model; }
public function actionSend() { $model = new Emails(); $this->_prepairJson(); $orderId = $this->_request->getParam('orderId'); $typeId = $this->_request->getParam('typeId'); $back = $this->_request->getParam('back'); $cost = $this->_request->getParam('cost'); $order = Zakaz::model()->findByPk($orderId); $arr_type = array(Emails::TYPE_18, Emails::TYPE_19, Emails::TYPE_20, Emails::TYPE_21, Emails::TYPE_22, Emails::TYPE_23, Emails::TYPE_24); if (in_array($typeId, $arr_type)) { $user = User::model()->findByPk($order->executor); } else { $user = User::model()->findByPk($order->user_id); } $model->to_id = $user->id; $profile = Profile::model()->findAll("`user_id`='{$user->id}'"); $rec = Templates::model()->findAll("`type_id`='{$typeId}'"); $title = $rec[0]->title; $model->name = $profle->firstname; if (strlen($model->name) < 2) { $model->name = $user->username; } $model->login = $user->username; $model->num_order = $orderId; $model->page_order = 'http://' . $_SERVER['SERVER_NAME'] . '/project/chat?orderId=' . $orderId; $model->message = $rec[0]->text; $model->price_order = $cost; $this->sum_order = $cost; $model->sendTo($user->email, $rec[0]->text, $typeId); $model->save(); /* if (!isset($back)) $back = 'index'; $this->render($back, [ 'model'=>$model ]); */ }
public function flag_out($math, $ID) { $vnames = Vaccines::getVaccineName($ID); foreach ($vnames as $vname) { $flaged = urlencode($vname['Name']); @($message .= "VACCINES+STOCK+OUTS+%0A+{$flaged}"); //determines which type of sms to send } $smslevel = Emails::getSmslevel(); foreach ($smslevel as $levels) { $phones = $levels['number']; $this->send_sms($phones, $message, $math); } }
public function actionPendingMails() { // verify if are emails pending to send $emails = Emails::model()->findAll(array('condition' => 't.email_status = 0', 'limit' => Yii::app()->params['mailSendMultiples'])); if (count($emails) > 0) { foreach ($emails as $email) { Yii::import('application.extensions.phpMailer.yiiPhpMailer'); $mailer = new yiiPhpMailer(); if ($mailer->Ready($email->email_subject, $email->email_body, array('email' => $email->email_toMail, 'name' => $email->email_toName), $email->email_priority)) { $email->email_status = 1; $email->email_sentDate = date("Y-m-d G:i:s"); $email->save(false); } } } }
public function init() { // --- Организации $c_id = Campaign::getId(); if ($c_id) { Payment::$table_prefix = $c_id . '_'; //Profile::$table_prefix = $c_id.'_'; //ProfileField::$table_prefix = $c_id.'_'; ProjectChanges::$table_prefix = $c_id . '_'; ProjectChanges::$file_path = 'uploads/c' . $c_id . '/changes_documents'; //ProjectMessages::$table_prefix = $c_id.'_'; ProjectPayments::$table_prefix = $c_id . '_'; Zakaz::$table_prefix = $c_id . '_'; Zakaz::$files_folder = '/uploads/c' . $c_id . '/'; Events::$table_prefix = $c_id . '_'; ZakazParts::$table_prefix = $c_id . '_'; UpdateProfile::$table_prefix = $c_id . '_'; ZakazPartsFiles::$table_prefix = $c_id . '_'; PaymentImage::$table_prefix = $c_id . '_'; Emails::$table_prefix = $c_id . '_'; Yii::app()->language = Campaign::getLanguage(); } else { ProjectChanges::$file_path = 'uploads/changes_documents'; } // --- if (!Yii::app()->user->isGuest) { switch (User::model()->getUserRole()) { case 'Manager': case 'Admin': Yii::app()->theme = 'admin'; break; case 'Author': $this->menu = array(array('label' => Yii::t('site', 'My orders'), 'url' => array('/project/zakaz/ownList')), array('label' => Yii::t('site', 'New projects'), 'url' => array('/project/zakaz/list')), array('label' => Yii::t('site', 'Profile'), 'url' => array('/user/profile/edit')), array('label' => Yii::t('site', 'Logout'), 'url' => array('/user/logout'))); $this->authMenu = array(array('label' => Yii::t('site', 'Logout'), 'url' => array('/user/logout'))); Yii::app()->theme = 'client'; break; case 'Customer': $this->menu = array(array('label' => Yii::t('site', 'My orders'), 'url' => array('/project/zakaz/customerOrderList')), array('label' => Yii::t('site', 'Create order'), 'url' => array('/project/zakaz/create')), array('label' => Yii::t('site', 'Profile'), 'url' => array('/user/profile/edit')), array('label' => Yii::t('site', 'Logout'), 'url' => array('/user/logout'))); $this->authMenu = array(array('label' => Yii::t('site', 'Logout'), 'url' => array('/user/logout'))); Yii::app()->theme = 'client'; break; } } // var_dump(Yii::app()->controller->module->id ,Yii::app()->controller->id, Yii::app()->controller->action->id); // die(); }
/** * Model definition. */ function define() { // Fields. $this->fields = array('id', 'type', 'to', 'cc', 'bcc', 'from', 'subject', 'text', 'html', 'date_created'); $this->search_fields = array('to', 'subject'); // Validate. $this->validate = array('required' => array('type', 'to', 'from', 'subject', 'text')); // Indexes. $this->indexes = array('id' => 'unique', 'type'); // Event binds. $this->binds = array('POST' => function ($event, $model) { $data =& $event['data']; // Id as email type. $data['type'] = $data['type'] ?: $event['id']; unset($event['id']); // Prepare data for email message. $data = Emails::prepare_post_data($data); if (!$model->validate($data)) { return false; // Trigger special send event. /*if (false === trigger('emails', 'send', $data, $model)) { return false; }*/ } }); // Default send event. $this->bind('POST', function ($event, $model) { try { Emails::send_default($event['data']); // Indicate default mail gateway. $event['data']['gateway'] = 'default'; } catch (Exception $e) { $model->error($e->getMessage()); return false; } return true; }, 2); }
public function actionSend() { $email = new Emails(); $this->_prepairJson(); $orderId = $this->_request->getParam('orderId'); $typeId = $this->_request->getParam('typeId'); $back = $this->_request->getParam('back'); $cost = $this->_request->getParam('cost'); $order = Zakaz::model()->findByPk($orderId); $arr_type = array(Emails::TYPE_18, Emails::TYPE_19, Emails::TYPE_20, Emails::TYPE_21, Emails::TYPE_22, Emails::TYPE_23, Emails::TYPE_24); if (in_array($typeId, $arr_type)) { $user_id = $order->executor; } else { $user_id = $order->user_id; } if (!$user_id) { Yii::app()->end(); } $user = User::model()->findByPk($user_id); $email->to_id = $user_id; $profile = Profile::model()->findAll("`user_id`='{$user_id}'"); $rec = Templates::model()->findAll("`type_id`='{$typeId}'"); $title = $rec[0]->title; $email->name = $profle->full_name; if (strlen($email->name) < 2) { $email->name = $user->username; } $email->login = $user->username; $email->num_order = $orderId; $email->page_order = 'http://' . $_SERVER['SERVER_NAME'] . '/project/chat?orderId=' . $orderId; $email->message = $rec[0]->text; $email->price_order = $cost; $email->sum_order = $cost; $specials = Catalog::model()->findByPk($order->specials); $email->specialization = $specials->cat_name; $email->name_order = $order->title; $email->subject_order = $order->title; $email->sendTo($user->email, $rec[0]->title, $rec[0]->text, $typeId); }
* The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. * ********************************************************************************/ require_once 'Smarty_setup.php'; require_once 'data/Tracker.php'; require_once 'modules/Emails/Emails.php'; require_once 'include/utils/utils.php'; require_once 'include/utils/UserInfoUtil.php'; require_once 'modules/Webmails/MailBox.php'; require_once 'modules/Webmails/Webmails.php'; require_once "include/Zend/Json.php"; global $mod_strings; global $app_strings, $theme; $focus = new Emails(); $smarty = new vtigerCRM_Smarty(); $json = new Zend_Json(); $smarty->assign('MOD', $mod_strings); $smarty->assign('THEME', $theme); if (isset($_REQUEST['record']) && $_REQUEST['record'] != '' && $_REQUEST['mailbox'] == '') { $focus->id = $_REQUEST['record']; $focus->mode = 'edit'; $focus->retrieve_entity_info($_REQUEST['record'], "Emails"); $focus->name = $focus->column_fields['name']; if (isset($_REQUEST['print']) && $_REQUEST['print'] != '') { $query = 'select idlists,from_email,to_email,cc_email,bcc_email from vtiger_emaildetails where emailid =?'; $result = $adb->pquery($query, array($focus->id)); $smarty->assign('FROM_MAIL', $adb->query_result($result, 0, 'from_email')); $to_email = vt_suppressHTMLTags(implode(',', $json->decode($adb->query_result($result, 0, 'to_email')))); $smarty->assign('TO_MAIL', $to_email);
/** * Used (currently) in the installation script. Note: this function relies on the settings file having * been defined, along with an arbitrary encryption salt. * @param $accountInfo * @param bool $isCurrentUser * @return int */ public static function createAccount($accountInfo, $isCurrentUser = false) { $accountInfo = Utils::sanitize($accountInfo); $encryptionSalt = Core::getEncryptionSalt(); $accountType = $accountInfo["accountType"]; $firstName = isset($accountInfo["firstName"]) && !empty($accountInfo["firstName"]) ? $accountInfo["firstName"] : ""; $lastName = isset($accountInfo["lastName"]) && !empty($accountInfo["lastName"]) ? $accountInfo["lastName"] : ""; $email = isset($accountInfo["email"]) && !empty($accountInfo["email"]) ? $accountInfo["email"] : ""; $password = ""; if (isset($accountInfo["password"]) && !empty($accountInfo["password"])) { $password = crypt($accountInfo["password"], $encryptionSalt); } // TODO - this is weird! $autoEmail = isset($accountInfo["accountType"]) ? $accountInfo["accountType"] : false; $L = Core::$language->getCurrentLanguageStrings(); $now = Utils::getCurrentDatetime(); $prefix = Core::getDbTablePrefix(); $selectedDataTypes = Settings::getSetting("installedDataTypes"); $selectedExportTypes = Settings::getSetting("installedExportTypes"); $selectedCountries = Settings::getSetting("installedCountries"); $result = Core::$db->query("\n\t\t\tINSERT INTO {$prefix}user_accounts (date_created, last_updated, date_expires, last_logged_in, account_type, \n\t\t\t\tfirst_name, last_name, email, password, selected_data_types, selected_export_types, selected_countries)\n\t\t\tVALUES ('{$now}', '{$now}', '{$now}', NULL, '{$accountType}', '{$firstName}', '{$lastName}', '{$email}', '{$password}',\n\t\t\t\t'{$selectedDataTypes}', '\${$selectedExportTypes}', '{$selectedCountries}')\n\t\t"); $emailSent = false; // not used yet, but we should notify the user via the interface if ($autoEmail) { try { $content = $L["account_created_msg"] . "\n\n"; if (isset($_SERVER["HTTP_REFERER"]) && !empty($_SERVER["HTTP_REFERER"])) { $content .= "{$L["login_url_c"]} {$_SERVER["HTTP_REFERER"]}\n"; } $content .= "{$L["email_c"]} {$email}\n{$L["password_c"]} {$accountInfo["password"]}\n"; Emails::sendEmail(array("recipient" => $email, "subject" => $L["account_created"], "content" => $content)); $emailSent = true; } catch (Exception $e) { $emailSent = false; } } $returnInfo = array("success" => $result["success"]); if ($result["success"]) { $accountID = mysqli_insert_id(Core::$db->getDBLink()); if ($isCurrentUser) { Core::initSessions(); $_SESSION["account_id"] = $accountID; Core::initUser(true); } $returnInfo["accountID"] = $accountID; } return $returnInfo; }
/** * @param $context \Workflow\VTEntity * @return mixed */ public function handleTask(&$context) { global $adb, $current_user; global $current_language; if (defined("WF_DEMO_MODE") && constant("WF_DEMO_MODE") == true) { return "yes"; } if (!class_exists("Workflow_PHPMailer")) { require_once "modules/Workflow2/phpmailer/class.phpmailer.php"; } #$result = $adb->query("select user_name, email1, email2 from vtiger_users where id=1"); #$from_email = "*****@*****.**"; #$from_name = "Stefan Warnat"; $module = $context->getModuleName(); $et = new \Workflow\VTTemplate($context); $to_email = $et->render(trim($this->get("recepient")), ","); # $connected = $this->getConnectedObjects("Absender"); if (count($connected) > 0) { $from_name = trim($connected[0]->get("first_name") . " " . $connected[0]->get("last_name")); $from_email = $connected[0]->get("email1"); } else { $from_name = $et->render(trim($this->get("from_name")), ","); # $from_email = $et->render(trim($this->get("from_mail")), ","); # } $cc = $et->render(trim($this->get("emailcc")), ","); # $bcc = $et->render(trim($this->get("emailbcc")), ","); # /** * Connected BCC Objects * @var $connected */ $connected = $this->getConnectedObjects("BCC"); $bccs = $connected->get("email1"); if (count($bccs) > 0) { $bcc = array($bcc); foreach ($bccs as $bccTMP) { $bcc[] = $bccTMP; } $bcc = trim(implode(",", $bcc), ","); } if (strlen(trim($to_email, " \t\n,")) == 0 && strlen(trim($cc, " \t\n,")) == 0 && strlen(trim($bcc, " \t\n,")) == 0) { return "yes"; } $storeid = trim($this->get("storeid", $context)); if (empty($storeid) || $storeid == -1 || !is_numeric($storeid)) { $storeid = $context->getId(); } $embeddedImages = array(); $content = $this->get("content"); $subject = $this->get("subject"); #$subject = utf8_decode($subject); #$content = utf8_encode($content); $content = html_entity_decode(str_replace(" ", " ", $content), ENT_QUOTES, "UTF-8"); #$subject = html_entity_decode(str_replace(" ", " ", $subject), ENT_QUOTES, "UTF-8"); $subject = $et->render(trim($subject)); $content = $et->render(trim($content)); $mailtemplate = $this->get("mailtemplate"); if (!empty($mailtemplate) && $mailtemplate != -1) { if (strpos($mailtemplate, 's#') === false) { $sql = "SELECT * FROM vtiger_emailtemplates WHERE templateid = " . intval($mailtemplate); $result = $adb->query($sql); $mailtemplate = $adb->fetchByAssoc($result); $content = str_replace('$mailtext', $content, html_entity_decode($mailtemplate["body"], ENT_COMPAT, 'UTF-8')); $content = Vtiger_Functions::getMergedDescription($content, $context->getId(), $context->getModuleName()); } else { $parts = explode('#', $mailtemplate); switch ($parts[1]) { case 'emailmaker': $templateid = $parts[2]; $sql = 'SELECT body, subject FROM vtiger_emakertemplates WHERE templateid = ?'; $result = $adb->pquery($sql, array($templateid)); $EMAILContentModel = \EMAILMaker_EMAILContent_Model::getInstance($this->getModuleName(), $context->getId(), $current_language, $context->getId(), $this->getModuleName()); $EMAILContentModel->setSubject($adb->query_result($result, 0, 'subject')); $EMAILContentModel->setBody($adb->query_result($result, 0, 'body')); $EMAILContentModel->getContent(true); $embeddedImages = $EMAILContentModel->getEmailImages(); $subject = $EMAILContentModel->getSubject(); $content = $EMAILContentModel->getBody(); break; } } } #$content = htmlentities($content, ENT_NOQUOTES, "UTF-8"); if (getTabid('Emails') && vtlib_isModuleActive('Emails')) { require_once 'modules/Emails/Emails.php'; $focus = new Emails(); $focus->column_fields["assigned_user_id"] = \Workflow\VTEntity::getUser()->id; $focus->column_fields["activitytype"] = "Emails"; $focus->column_fields["date_start"] = date("Y-m-d"); $focus->column_fields["parent_id"] = $storeid; $focus->column_fields["email_flag"] = "SAVED"; $focus->column_fields["subject"] = $subject; $focus->column_fields["description"] = $content; $focus->column_fields["from_email"] = $from_email; $focus->column_fields["saved_toid"] = '["' . str_replace(',', '","', trim($to_email, ",")) . '"]'; $focus->column_fields["ccmail"] = $cc; $focus->column_fields["bccmail"] = $bcc; $focus->save("Emails"); $this->_mailRecord = $focus; #error_log("eMail:".$emailID); $emailID = $focus->id; } else { $emailID = ""; } $attachments = json_decode($this->get("attachments"), true); if (is_array($attachments) && count($attachments) > 0) { // Module greifen auf Datenbank zurück. Daher vorher speichern! $context->save(); foreach ($attachments as $key => $value) { if ($value == false) { continue; } if (is_string($value)) { $value = array($value, false, array()); } // legacy check if (strpos($key, 'document#') === 0) { $key = 's#' . $key; } if (strpos($key, 's#') === 0) { $tmpParts = explode('#', $key, 2); $specialAttachments = \Workflow\Attachment::getAttachments($tmpParts[1], $value, $context, \Workflow\Attachment::MODE_NOT_ADD_NEW_ATTACHMENTS); foreach ($specialAttachments as $attachment) { if ($attachment[0] === 'ID') { $this->attachByAttachmentId($attachment[1]); } elseif ($attachment[0] === 'PATH') { $this->attachFile($attachment[1], $attachment[2], $attachment[3]); } } } else { $file = \Workflow\InterfaceFiles::getFile($key, $this->getModuleName(), $context->getId()); $this->attachFile($file['path'], $value[1] != false ? $value[1] : $file['name'], $file['type']); } } } $receiver = explode(",", $to_email); foreach ($receiver as $to_email) { $to_email = trim($to_email); if (empty($to_email)) { continue; } if (DEMO_MODE == false) { // Self using $mail = new Workflow_PHPMailer(); $mail->CharSet = 'utf-8'; $mail->IsSMTP(); foreach ($embeddedImages as $cid => $cdata) { $mail->AddEmbeddedImage($cdata["path"], $cid, $cdata["name"]); } setMailServerProperties($mail); $to_email = trim($to_email, ","); #setMailerProperties($mail,$subject, $content, $from_email, $from_name, trim($to_email,","), "all", $emailID); $mail->Timeout = 60; $mail->FromName = $from_name; $mail->From = $from_email; $this->addStat("From: " . $from_name . " <" . $from_email . ">"); if ($this->get('trackAccess') == '1') { //Including email tracking details global $site_URL, $application_unique_key; $counterUrl = $site_URL . '/modules/Emails/actions/TrackAccess.php?parentId=' . $storeid . '&record=' . $focus->id . '&applicationKey=' . $application_unique_key; $counterHeight = 1; $counterWidth = 1; if (defined('TRACKING_IMG_HEIGHT')) { $counterHeight = TRACKING_IMG_HEIGHT; } if (defined('TRACKING_IMG_WIDTH')) { $counterWidth = TRACKING_IMG_WIDTH; } $content = "<img src='" . $counterUrl . "' alt='' width='" . $counterWidth . "' height='" . $counterHeight . "'>" . $content; } $mail->Subject = $subject; $this->addStat("Subject: " . $subject); $mail->MsgHTML($content); $mail->SMTPDebug = 2; $mail->addAddress($to_email); $this->addStat("To: " . $to_email); setCCAddress($mail, 'cc', $cc); setCCAddress($mail, 'bcc', $bcc); #$mail->IsHTML(true); addAllAttachments($mail, $emailID); try { ob_start(); $mail_return = MailSend($mail); $debug = ob_get_clean(); $this->addStat($debug); } catch (Workflow_phpmailerException $exp) { Workflow2::error_handler($exp->getCode(), $exp->getMessage(), $exp->getFile(), $exp->getLine()); } #$mail_return = send_mail($module, $to_email,$from_name,$from_email,$subject,$content, $cc, $bcc,'all',$emailID); } else { $mail_return = 1; } $this->addStat("Send eMail with following Result:"); $this->addStat($mail_return); if ($mail_return != 1) { if (empty($mail->ErrorInfo) && empty($mail_return)) { $mail_return = 1; } } $context->setEnvironment("sendmail_result", $mail_return, $this); if ($mail_return != 1) { if ($this->isContinued()) { $delay = 180; } else { $delay = 60; } Workflow2::send_error("Sendmail Task couldn't send an email to " . $to_email . "<br>Error: " . var_export($mail->ErrorInfo, true) . "<br><br>The Task will be rerun after " . $delay . " minutes.", __FILE__, __LINE__); Workflow2::error_handler(E_NONBREAK_ERROR, "Sendmail Task couldn't send an email to " . $to_email . "<br>Error: " . var_export($mail->ErrorInfo, true) . "<br><br>The Task will be rerun after " . $delay . " minutes.", __FILE__, __LINE__); return array("delay" => time() + $delay * 60, "checkmode" => "static"); } } // Set Mails as Send $sql = "UPDATE vtiger_emaildetails SET email_flag = 'SENT' WHERE emailid = '" . $emailID . "'"; $adb->query($sql); return "yes"; }
public function send_deffered_emails() { $emails = Emails::model()->sending_round(self::EMAILS_COUNT)->findAll(); foreach ($emails as $email) { if ($email->send()) { $email->delete(); } } }
/** * Used (currently) in the installation script. Note: this function relies on the settings file having * been defined, along with an arbitrary encryption salt. * * This is static because it's used during the installation process to create the default account. But in * all other cases its used by the admin only. * * @param array $accountInfo */ public static function createAccount($accountInfo) { $accountInfo = Utils::sanitize($accountInfo); $encryptionSalt = Core::getEncryptionSalt(); $accountType = $accountInfo["accountType"]; $firstName = $accountInfo["firstName"]; $lastName = $accountInfo["lastName"]; $email = $accountInfo["email"]; $password = crypt($accountInfo["password"], $encryptionSalt); $autoEmail = isset($accountInfo["accountType"]) ? $accountInfo["accountType"] : false; $L = Core::$language->getCurrentLanguageStrings(); $now = Utils::getCurrentDatetime(); $prefix = Core::getDbTablePrefix(); $result = Core::$db->query("\n\t\t\tINSERT INTO {$prefix}user_accounts (date_created, last_updated, date_expires, last_logged_in, account_type, \n\t\t\t\tfirst_name, last_name, email, password)\n\t\t\tVALUES ('{$now}', '{$now}', '{$now}', NULL, '{$accountType}', '{$firstName}', '{$lastName}', '{$email}', '{$password}')\n\t\t"); if ($autoEmail) { $content = $L["account_created_msg"] + "\n"; if (isset($_SERVER["HTTP_REFERER"]) && !empty($_SERVER["HTTP_REFERER"])) { $content .= "Login URL: {$_SERVER["HTTP_REFERER"]}\n"; } $content .= "Email: {$email}\nPassword: {$accountInfo["password"]}\n"; $response = Emails::sendEmail(array("recipient" => $email, "subject" => $L["account_created"], "content" => $content)); } // if ($result["success"]) { // $accountID = mysql_insert_id();; // Core::initSessions(); // $_SESSION["account_id"] = $accountID; // Core::initUser(true); // } }
/** * Entry point for Create a User API * * @param Request $r * @return array * @throws InvalidDatabaseOperationException * @throws DuplicatedEntryInDatabaseException */ public static function apiCreate(Request $r) { // Validate request Validators::isValidUsername($r['username'], 'username'); Validators::isEmail($r['email'], 'email'); // Check password $hashedPassword = null; if (!isset($r['ignore_password'])) { SecurityTools::testStrongPassword($r['password']); $hashedPassword = SecurityTools::hashString($r['password']); } // Does user or email already exists? try { $user = UsersDAO::FindByUsername($r['username']); $userByEmail = UsersDAO::FindByEmail($r['email']); } catch (Exception $e) { throw new InvalidDatabaseOperationException($e); } if (!is_null($userByEmail)) { throw new DuplicatedEntryInDatabaseException('mailInUse'); } if (!is_null($user)) { throw new DuplicatedEntryInDatabaseException('usernameInUse'); } // Prepare DAOs $user_data = array('username' => $r['username'], 'password' => $hashedPassword, 'solved' => 0, 'submissions' => 0, 'verified' => 0, 'verification_id' => self::randomString(50)); if (isset($r['name'])) { $user_data['name'] = $r['name']; } if (isset($r['facebook_user_id'])) { $user_data['facebook_user_id'] = $r['facebook_user_id']; } if (!is_null(self::$permissionKey) && self::$permissionKey == $r['permission_key']) { $user_data['verified'] = 1; } elseif (OMEGAUP_VALIDATE_CAPTCHA) { // Validate captcha if (!isset($r['recaptcha'])) { throw new InvalidParameterException('parameterNotFound', 'recaptcha'); } $url = 'https://www.google.com/recaptcha/api/siteverify'; $data = array('secret' => OMEGAUP_RECAPTCHA_SECRET, 'response' => $r['recaptcha'], 'remoteip' => $_SERVER['REMOTE_ADDR']); // use key 'http' even if you send the request to https://... $options = array('http' => array('header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data))); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); if ($result === false) { self::$log->error('POST Request to Google Recaptcha failed.'); throw new CaptchaVerificationFailedException(); } $resultAsJson = json_decode($result, true); if (is_null($resultAsJson)) { self::$log->error('Captcha response was not a json'); self::$log->error('Here is the result:' . $result); throw new CaptchaVerificationFailedException(); } if (!(array_key_exists('success', $resultAsJson) && $resultAsJson['success'])) { self::$log->error('Captcha response said no'); throw new CaptchaVerificationFailedException(); } } $user = new Users($user_data); $email = new Emails(array('email' => $r['email'])); // Save objects into DB try { DAO::transBegin(); UsersDAO::save($user); $email->setUserId($user->getUserId()); EmailsDAO::save($email); $user->setMainEmailId($email->getEmailId()); UsersDAO::save($user); DAO::transEnd(); } catch (Exception $e) { DAO::transRollback(); throw new InvalidDatabaseOperationException($e); } $r['user'] = $user; if (!$user->verified) { self::$log->info('User ' . $user->getUsername() . ' created, sending verification mail'); self::sendVerificationEmail($r); } else { self::$log->info('User ' . $user->getUsername() . ' created, trusting e-mail'); } return array('status' => 'ok', 'user_id' => $user->getUserId()); }
public function getAsap() { $records = Emails::all(); foreach ($records as $record) { $receive_alert = $record->receive_alert; } if ($receive_alert = 'ASAP') { $records = Emails::where('receive_alert', $receive_alert)->get(); foreach ($records as $record) { $id = $record->user_id; $emls = User::where('id', $id)->get(); foreach ($emls as $eml) { $adr = $eml->email; } $property = Profolio::where('asap', 1)->get(); if ($property->isEmpty()) { echo "no property added"; } else { $to = $adr; $subject = 'New property Add on zameen jayedad'; $message = null; foreach ($property as $propertys) { $message .= '<html> <body> <table width="740px;" class="MsoTableLightShadingAccent1" border="1" cellspacing="0" cellpadding="0" style="color:#333; border-collapse:collapse;border:none; font-family: Helvetica, Arial, sans-serif; text-align: center; width=740px;"> <tr> <td align="center" width="250px;" style="border: 1px solid #333; width=150px; transition: all 0.3s; background: #FAFAFA; text-align: center; " ><b> App Type </b></td> <td align="center" style="border: 1px solid #333; width=370px; transition: all 0.3s; background: #FAFAFA; text-align: center; " >' . $propertys->property_type . '</td> </tr> <tr> <td align="center" width="250px;" style="border: 1px solid #333; width=150px; transition: all 0.3s; background: #FAFAFA; text-align: center; " ><b> purpose </b></td> <td align="center" style="border: 1px solid #333; width=370px; transition: all 0.3s; background: #FAFAFA; text-align: center; " >' . $propertys->purpose . '</td> </tr> <tr> <td align="center" width="250px;" style="border: 1px solid #333; width=150px; transition: all 0.3s; background: #FAFAFA; text-align: center; " ><b> Address </b></td> <td align="center" style="border: 1px solid #333; width=370px; transition: all 0.3s; background: #FAFAFA; text-align: center; " >' . $propertys->location . '</td> </tr> <tr> <td align="center" width="250px;" style="border: 1px solid #333; width=150px; transition: all 0.3s; background: #FAFAFA; text-align: center; " ><b> photo </b></td> <td align="center" style="border: 1px solid #333; width=370px; transition: all 0.3s; background: #FAFAFA; text-align: center; " ><img width="200" height="150" src="http://zameenjayedad.com.pk/uploads/photos/' . $propertys->photo . '"</td> </tr> <tr> <td align="center" width="250px;" style="border: 1px solid #333; width=150px; transition: all 0.3s; background: #FAFAFA; text-align: center; " ><b> App Logo </b></td> <td align="center" style="border: 1px solid #333; width=370px; transition: all 0.3s; background: #FAFAFA; text-align: center; " > <a href="http://zameenjayedad.com.pk/dashboard/listing/guest/' . $propertys->id . '">Detail</a></td> </tr> </table> </body> </html> <br/>'; } // $URL ='Property type :'.$propertys->property_type.'<br/>'.'purpose :'.$propertys->purpose.'<br/>'.'location :'.$propertys->location.'<br/>' // .'budget :'.$propertys->budget.'Area :'.$propertys->l_area.'<br/>'.'Contact Person :'.$propertys->contact_p.'<br/>' // .'Cell Num :'.$propertys->cell.'<br/>'.'Email :'.$propertys->email; // $this->sendTo($adr,array('activationCode'=>$URL)); $headers = "From: " . strip_tags('zameenjayedad.com') . "\r\n"; $headers .= "Reply-To: " . strip_tags('zameenjayedad.com') . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; mail($to, $subject, $message, $headers); DB::table('property')->where('asap', 1)->update(array('asap' => 0)); } } } }
public function actionSetTechSpec() { $orderId = $_POST['orderId']; $val = $_POST['val']; $order = Zakaz::model()->findByPk($orderId); if (!$order) { throw new CHttpException(500); } $order->technicalspec = $val; $order->save(); if ($val) { $criteria = new CDbCriteria(); if (Company::getId()) { $projectFields = $order->getFields(); if ($projectFields) { foreach ($projectFields as $field) { if ($field->required == ProjectField::REQUIRED_YES_REG_SPAM) { $varname = $field->varname; $value = $order->{$varname}; $criteria->addSearchCondition('profile.' . $varname, $value); } } } } $criteria->addSearchCondition('AuthAssignment.itemname', 'Corrector'); $authors = User::model()->with('profile', 'AuthAssignment')->findAll($criteria); if (!empty($authors)) { /*$link = $this->createAbsoluteUrl('/project/chat/', ['orderId' => $orderId]); $mail = new YiiMailer(); $mail->clearLayout(); $mail->setFrom(Yii::app()->params['supportEmail'], Yii::app()->name); $mail->setSubject('Приглашение в проект'); $link = 'http://'.$_SERVER['SERVER_NAME'].'/project/chat?orderId='.$orderId; $mail->setBody('<a href="'.$link.'">'.$link.'</a>');*/ // новая рассылка $typeId = Emails::TYPE_26; $rec = Templates::model()->findAll("`type_id`='{$typeId}'"); foreach ($authors as $user) { //$specials = explode(',',$user->profile->specials); //if (!in_array($order->specials, $specials)) continue; $email = new Emails(); $email->to_id = $user->id; // to rm ?? $email->name = $user->full_name; if (strlen($email->name) < 2) { $email->name = $user->username; } $email->login = $user->username; $email->num_order = $orderId; $email->page_order = 'http://' . $_SERVER['SERVER_NAME'] . '/project/chat?orderId=' . $orderId; $specials = isset($order->specials) ? $order->specials : $order->specials2; $specials = Catalog::model()->findByPk($specials); $email->specialization = $specials->cat_name; $email->name_order = $order->title; $email->subject_order = $order->title; $email->sendTo($user->email, $rec[0]->title, $rec[0]->text, $typeId); } echo 'send_email'; } else { echo 'no_users'; } } Yii::app()->end(); }
function email_sender($report_name, $start_date, $end_date, $district_or_region, $vals, $store) { //setting the connection variables $config['protocol'] = 'smtp'; $config['smtp_host'] = 'ssl://smtp.googlemail.com'; $config['smtp_port'] = 465; $config['smtp_user'] = stripslashes('*****@*****.**'); $config['smtp_pass'] = stripslashes('projectDVI'); ini_set("SMTP", "ssl://smtp.gmail.com"); ini_set("smtp_port", "465"); ini_set("max_execution_time", "50000"); if ($vals == 1) { $emails = Emails::getProvinceEmails($district_or_region); } else { if ($vals == 2) { $emails = Emails::getDistrictEmails($district_or_region); } else { if ($vals == 3) { $emails = Emails::getEmails(); } } } //pulling emails from the DB $this->load->library('email', $config); $path = $_SERVER["DOCUMENT_ROOT"]; $file = $path . "/DVI/application/pdf/" . $report_name; //puts the path where the pdf's are stored foreach ($emails as $email) { $this->email->attach($file); $address = $email['email']; $this->email->set_newline("\r\n"); $start_text_date = date("M j, Y", strtotime($start_date)); $end_text_date = date("M j, Y", strtotime($end_date)); $this->email->from('*****@*****.**', "DVI MAILER"); //user variable displays current user logged in from sessions $this->email->to("{$address}"); $this->email->subject("{$store}" . ' MONTHLY REPORT.'); $this->email->message('Please find the Report Attached for ' . "{$store}" . ' Period of ' . "{$start_text_date}" . ' to ' . "{$end_text_date}"); //success message else show the error if ($this->email->send()) { echo 'Your email was sent, successfully to ' . $address . '<br/>'; //unlink($file); $this->email->clear(TRUE); } else { show_error($this->email->print_debugger()); } } ob_end_flush(); unlink($file); //delete the attachment after sending to avoid clog up of pdf's }
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 ""; } } }
public static function RecoverPassword($id, $request_type = null) { //Generate Random Password of 6 characters $password = self::GenerateRandomPassword(Constant::PASSWORD_MIMIMUM_LENGTH); //Encrypt password $password_encrypted = self::EncryptPassword($password); //check if this employee exists $employee = EmployeePeer::retrieveByPK($id); if ($employee) { $employee->setPassword($password_encrypted); //Set newly created password to databaes if ($employee->save()) { //send the new password and other details to use via email //prepare the constants that will be replaced in email body $email_vars = array('USER' => $employee->getName(), 'EMAIL' => $employee->getEmail(), 'PASSWORD' => $password); Emails::SendEmail($employee->getEmail(), $request_type, $email_vars); return Constant::LOGIN_PASSWORD_SENT_SUCCESS; } else { return Constant::DB_ERROR; } } else { return Constant::LOGIN_INVALIDATION_EMAIL_FIELD; } }
<?php Output::set_title("Emails to the Studio"); $limit = isset($_GET['n']) ? $_GET['n'] : 10; $page = isset($_REQUEST['p']) ? $_REQUEST['p'] : 1; $emails = Emails::get(NULL, NULL, NULL, $limit, ($page - 1) * $limit); $pages = new Paginator(); $pages->items_per_page = $limit; $pages->mid_range = 3; $pages->items_total = Emails::count(); $pages->paginate(); $low = ($page - 1) * $limit + 1; $high = $low + $limit - 1 > 200 ? 200 : $low + $limit - 1; ?> <style type="text/css"> .subject, .sender { display:block; word-wrap: break-word; width: 100%; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; } .subject { font-weight:bold; } .sender { font-size:0.8em; } small { display:block; margin-bottom:10px; } #message { overflow:auto; } tbody tr { cursor:pointer; } .pagination { text-align: center; } </style> <script type="text/javascript"> $(function(){ $('tbody tr').click(function(){ $.getJSON('../ajax/emailmessage.php?id='+$(this).attr('data-dps-email-id'), function(data) { $('#message').html('<div class="panel-heading"><h4>'+data.subject+'</h4><h5>'+data.sender+'</h5></div><div class="panel-body">'+data.message+'</div>'); }); }); $('#message').height($('#messagelist table').height()-20);
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Emails the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Emails::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
require_once 'endpoints/documents.php'; require_once 'endpoints/emails.php'; require_once 'endpoints/files.php'; require_once 'endpoints/folders.php'; require_once 'endpoints/formInstance.php'; require_once 'endpoints/formTemplates.php'; require_once 'endpoints/groups.php'; require_once 'endpoints/indexFields.php'; require_once 'endpoints/meta.php'; require_once 'endpoints/parse.php'; require_once 'endpoints/pData.php'; require_once 'endpoints/sites.php'; require_once 'endpoints/users.php'; // CLASS INSTANTIATIONS $docRequest = new Documents(); $emailRequest = new Emails(); $filesRequest = new Files(); $foldersRequest = new Folders(); $formInstanceRequest = new FormInstance(); $formTemplatesRequest = new FormTemplates(); $groupsRequest = new Groups(); $indexFieldsRequest = new IndexFields(); $metaRequest = new Meta(); $parseRequest = new Parse(); $pdataRequest = new PersistedData(); $sitesRequest = new Sites(); $usersRequest = new Users(); // ------------------------- REQUESTS --------------------------- // DOCUMENTS echo $docRequest->deleteDoc('7a6a7f74-3b82-e511-bf04-008cfa482110'); echo $docRequest->getDoc('name%20eq%20%27test%20-2%20-%20test%27');