本文整理汇总了PHP中Emails类的典型用法代码示例。如果您正苦于以下问题:PHP Emails类的具体用法?PHP Emails怎么用?PHP Emails使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Emails类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 > 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;
}
}
开发者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
示例16: actionSend
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);
}
开发者ID:akoch-ov,项目名称:dipstart-development,代码行数:39,代码来源:EmailsController.php
示例17: Emails
* 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);
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:31,代码来源:PrintEmail.php
示例18: createAccount
/**
* 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;
}
开发者ID:JaeHoYun,项目名称:generatedata,代码行数:55,代码来源:Account.class.php
示例19: handleTask
/**
* @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 = "[email protected]";
#$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;
//.........这里部分代码省略.........
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:101,代码来源:WfTaskSendmail.php
示例20: send_deffered_emails
public function send_deffered_emails()
{
$emails = Emails::model()->sending_round(self::EMAILS_COUNT)->findAll();
foreach ($emails as $email) {
if ($email->send()) {
$email->delete();
}
}
}
开发者ID:akoch-ov,项目名称:dipstart-development,代码行数:9,代码来源:EventsCommand.php
注:本文中的Emails类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论