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


PHP Emails类代码示例

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


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

示例1: forgotpassAction

 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>";
     }
 }
开发者ID:joshauza,项目名称:baseapp,代码行数:28,代码来源:LoginController.php

示例2: pushMail

 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);
             }
         }
     }
 }
开发者ID:lanzelotik,项目名称:celestic-community,代码行数:28,代码来源:yiiPhpMailer.php

示例3: 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 = 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 &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:casati-dolibarr,项目名称:corebos,代码行数:49,代码来源:thunderbirdplugin.php

示例4: actionBackgroundProcess

 /**
  * 
  * @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";
 }
开发者ID:lanzelotik,项目名称:celestic-community,代码行数:31,代码来源:SiteController.php

示例5: beforeAction

 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;
 }
开发者ID:rMarinf,项目名称:JugadorNum12,代码行数:26,代码来源:Controller.php

示例6: get_sms_level

 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);
     }
 }
开发者ID:EuniceManyasi,项目名称:DVI,代码行数:9,代码来源:vaccines_consumption.php

示例7: get_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);
     }
 }
开发者ID:EuniceManyasi,项目名称:DVI,代码行数:9,代码来源:auto_sms_provincial.php

示例8: get_phone_number

 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
 }
开发者ID:EuniceManyasi,项目名称:DVI,代码行数:11,代码来源:vaccine_consumption_provincial.php

示例9: __CreateNewEmail

 /**
  * 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;
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:48,代码来源:Relate.php

示例10: loadUpdateEmail

 /**
  * 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;
 }
开发者ID:edii,项目名称:testYii,代码行数:17,代码来源:SiteController.php

示例11: actionSend

 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
             ]);
     */
 }
开发者ID:kibercoder,项目名称:dipstart-development,代码行数:38,代码来源:EmailsController.php

示例12: flag_out

 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);
     }
 }
开发者ID:EuniceManyasi,项目名称:DVI,代码行数:14,代码来源:auto_sms.php

示例13: actionPendingMails

 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);
             }
         }
     }
 }
开发者ID:lanzelotik,项目名称:celestic-community,代码行数:16,代码来源:BackgroundCommand.php

示例14: init

 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();
 }
开发者ID:kibercoder,项目名称:dipstart-development,代码行数:46,代码来源:Controller.php

示例15: define

 /**
  * 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);
 }
开发者ID:kfuchs,项目名称:fwdcommerce,代码行数:42,代码来源:Emails.php


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