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


PHP Shineisp_Commons_Utilities::SendEmail方法代码示例

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


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

示例1: eu_check

 private function eu_check()
 {
     $isp = Shineisp_Registry::get('ISP');
     $VIES = new SoapClient($this->vies_soap_url);
     if ($VIES) {
         try {
             $r = $VIES->checkVat(array('countryCode' => $this->countryCode, 'vatNumber' => $this->vat));
             foreach ($r as $chiave => $valore) {
                 $this->viesOutput[$chiave] = $valore;
             }
             return $r->valid;
         } catch (SoapFault $e) {
             $ret = $e->faultstring;
             $regex = '/\\{ \'([A-Z_]*)\' \\}/';
             $n = preg_match($regex, $ret, $matches);
             $ret = !empty($matches[1]) ? $matches[1] : $ret;
             $faults = array('INVALID_INPUT' => 'The provided CountryCode is invalid or the VAT number is empty', 'SERVICE_UNAVAILABLE' => 'The SOAP service is unavailable, try again later', 'MS_UNAVAILABLE' => 'The Member State service is unavailable, try again later or with another Member State', 'TIMEOUT' => 'The Member State service could not be reached in time, try again later or with another Member State', 'SERVER_BUSY' => 'The service cannot process your request. Try again later.');
             $ret = $faults[$ret];
             // adding a log message
             Shineisp_Commons_Utilities::log("Response from VIES: " . $ret);
             $subject = 'Invalid VAT code';
             $body = "Response from VIES: " . $ret;
             Shineisp_Commons_Utilities::SendEmail($isp->email, $isp->email, null, $subject, $body);
             return false;
         }
     } else {
         $subject = 'Connect to VIES';
         $body = "Impossible to connect with VIES";
         Shineisp_Commons_Utilities::SendEmail($isp->email, $isp->email, null, $subject, $body);
         // adding a log message
         Shineisp_Commons_Utilities::log("Response from VIES: " . $ret);
         return false;
     }
     return true;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:35,代码来源:Vat.php

示例2: indexAction

 public function indexAction()
 {
     $auth = Zend_Auth::getInstance();
     $registry = Shineisp_Registry::getInstance();
     $translation = Shineisp_Registry::get('Zend_Translate');
     $retval = array();
     if ($auth->hasIdentity()) {
         $request = Zend_Controller_Front::getInstance()->getRequest();
         try {
             $form = new Admin_Form_BulkmailForm(array('action' => '/admin/bulkmail/#bulkmail', 'method' => 'post'));
             if ($request->isPost()) {
                 $isp = Isp::getActiveISP();
                 if ($form->isValid($request->getPost())) {
                     $data = $request->getPost();
                     $mail = new Bulkmails();
                     $mail->subject = $data['subject'];
                     $mail->body = $data['body'];
                     $mail->senddate = date('Y-m-d H:i:s');
                     $mail->save();
                     $customers = Customers::getEmails();
                     foreach ($customers as $customer) {
                         $body = str_replace('{fullname}', $customer['fullname'], $data['body']);
                         $result = Shineisp_Commons_Utilities::SendEmail($isp['email'], $customer['email'], null, $data['subject'], $body, true);
                         if ($result !== true) {
                             $retval[] = $result;
                         }
                     }
                 }
             }
             $retval = count($retval) > 0 ? $retval : null;
             $this->view->form = $form;
             $this->view->title = $translation->translate("Mass eMail");
             $this->view->description = $translation->translate("Write here a message to send to all your own customers.");
             $this->view->errors = $retval;
         } catch (Exception $e) {
             die($e->getMessage());
         }
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:39,代码来源:BulkmailController.php

示例3: send_queue

 /**
  * Send the newsletter to the queue
  */
 public static function send_queue($test = FALSE, $id = NULL)
 {
     $queue = NewslettersHistory::get_active_queue($test, $id);
     $isp = Isp::getActiveISP();
     try {
         // Get the template from the main email template folder
         $retval = Shineisp_Commons_Utilities::getEmailTemplate('newsletter');
         if (!empty($retval) && !empty($queue)) {
             $contents = Newsletters::fill_content();
             $subject = $retval['subject'];
             $template = $retval['template'];
             $subject = str_replace("[subject]", $queue[0]['Newsletters']['subject'], $subject);
             $template = str_replace("[subject]", $queue[0]['Newsletters']['subject'], $template);
             $template = str_replace("[body]", $queue[0]['Newsletters']['message'], $template);
             foreach ($contents as $name => $content) {
                 $template = str_replace("[" . $name . "]", $content, $template);
             }
             foreach ($isp as $field => $value) {
                 $template = str_replace("[" . $field . "]", $value, $template);
             }
             $template = str_replace("[url]", "http://" . $_SERVER['HTTP_HOST'] . "/media/newsletter/", $template);
             foreach ($queue as $item) {
                 // Send a test of the newsletter to the default isp email otherwise send an email to the queue
                 if ($test) {
                     $body = str_replace("[optout]", "#", $template);
                     Shineisp_Commons_Utilities::SendEmail($isp['email'], $isp['email'], null, "<!--TEST --> " . $subject, $body, true);
                     break;
                 } else {
                     // Create the optout link to be added in the email
                     $body = str_replace("[optout]", '<a href="http://' . $_SERVER['HTTP_HOST'] . "/newsletter/optout/id/" . MD5($item['NewslettersSubscribers']['email']) . '" >Unsubscribe</a>', $template);
                     $result = Shineisp_Commons_Utilities::SendEmail($isp['email'], $item['NewslettersSubscribers']['email'], null, $subject, $body, true);
                     if ($result === true) {
                         NewslettersHistory::set_status($item['subscriber_id'], $item['newsletter_id'], 1, "Mail Sent");
                     } else {
                         NewslettersHistory::set_status($item['subscriber_id'], $item['newsletter_id'], 0, $result['message']);
                     }
                     Newsletters::set_sending_date($item['news_id']);
                 }
             }
         }
     } catch (Exception $e) {
         echo $e->getMessage();
         return false;
     }
     return true;
 }
开发者ID:moay,项目名称:shineisp,代码行数:49,代码来源:Cronjobs.php

示例4: doDomainTask

 private function doDomainTask($task)
 {
     if (!isset($task['Domains']) || !isset($task['Domains']['Customers']) || !isset($task['Domains']['Customers']['customer_id'])) {
         PanelsActions::UpdateTaskLog($task['action_id'], $this->translations->translate('customer_id not found'));
     }
     $customer_id = intval($task['Domains']['Customers']['customer_id']);
     $ISP = Isp::getByCustomerId($customer_id);
     if (!$ISP || !isset($ISP['isp_id']) || !is_numeric($ISP['isp_id'])) {
         PanelsActions::UpdateTaskLog($task['action_id'], $this->translations->translate('isp_id not found'));
         return false;
     }
     try {
         // Getting domains details
         $domain = Domains::find($task['domain_id'], null, true);
         if (!empty($domain[0])) {
             $domain_name = $domain[0]['domain'] . "." . $domain[0]['tld'];
             // Get the associated registrar for the domain selected
             $registrar = Registrars::getRegistrarId($task['registrars_id']);
             if (!empty($registrar['class'])) {
                 // Create the class registrar object
                 $class = $registrar['class'];
                 $regclass = new $class();
                 $action = $task['action'];
                 // Check if the task is REGISTER or TRANSFER the domain name
                 if ($action == "registerDomain") {
                     $regclass->registerDomain($task['domain_id']);
                     // Set the DNS ZONES
                     DomainsTasks::AddTask($domain_name, "setDomainHosts");
                     // Update the domain information
                     DomainsTasks::AddTask($domain_name, "updateDomain");
                 } elseif ($action == "transferDomain") {
                     $regclass->transferDomain($task['domain_id']);
                 } elseif ($action == "renewDomain") {
                     $regclass->renewDomain($task['domain_id']);
                     // Update the domain information
                     DomainsTasks::AddTask($domain_name, "updateDomain");
                 } elseif ($action == "lockDomain") {
                     $regclass->lockDomain($task['domain_id']);
                 } elseif ($action == "unlockDomain") {
                     $regclass->unlockDomain($task['domain_id']);
                     // Update the domain information
                     DomainsTasks::AddTask($domain_name, "updateDomain");
                 } elseif ($action == "setNameServers") {
                     $regclass->setNameServers($task['domain_id']);
                 } elseif ($action == "setDomainHosts") {
                     $regclass->setDomainHosts($task['domain_id']);
                 } else {
                     $regclass->{$action}($task['domain_id']);
                 }
                 // Update the log description of the task
                 DomainsTasks::UpdateTaskLog($task['task_id'], $this->translations->translate("Your request has been executed."));
                 // Update the status of the task
                 DomainsTasks::UpdateTaskStatus($task['task_id'], Statuses::id('complete', 'domains_tasks'));
                 // Set the task as "Complete"
                 // Increment the task counter number
                 DomainsTasks::UpdateTaskCounter($task['task_id']);
                 // Set the status as Active
                 Domains::setStatus($task['domain_id'], Statuses::id('active', 'domains_tasks'));
             }
         }
     } catch (Exception $e) {
         DomainsTasks::UpdateTaskLog($task['task_id'], $this->translations->translate($e->getMessage()));
         Shineisp_Commons_Utilities::SendEmail($ISP['email'], $ISP['email'], null, "Task error message: " . $task['Domains']['domain'] . "." . $task['Domains']['tld'], $e->getMessage());
         Shineisp_Commons_Utilities::logs("Task error message: " . $task['Domains']['domain'] . "." . $task['Domains']['tld'] . ":" . $e->getMessage(), "tasks.log");
     }
     return true;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:67,代码来源:TasksController.php

示例5: processAction

 /**
  * processAction
  * Update the record previously selected
  * @return unknown_type
  */
 public function processAction()
 {
     $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
     $form = $this->getForm("/profile/process");
     $request = $this->getRequest();
     // Check if we have a POST request
     if (!$request->isPost()) {
         return $this->_helper->redirector('index', 'index', 'default');
     }
     if ($form->isValid($request->getPost())) {
         // Get the id
         $id = $this->getRequest()->getParam('customer_id');
         try {
             // Set the new values
             if (is_numeric($id)) {
                 $customer = Doctrine::getTable('Customers')->find($id);
                 $oldCustomer = $customer->toArray();
                 // Get the values posted
                 $params = $form->getValues();
                 $customer->company = $params['company'];
                 $customer->firstname = $params['firstname'];
                 $customer->lastname = $params['lastname'];
                 $customer->email = $params['email'];
                 $customer->birthdate = Shineisp_Commons_Utilities::formatDateIn($params['birthdate']);
                 if (!empty($params['password'])) {
                     $customer->password = MD5($params['password']);
                 }
                 $customer->birthplace = $params['birthplace'];
                 $customer->birthdistrict = $params['birthdistrict'];
                 $customer->birthcountry = $params['birthcountry'];
                 $customer->birthnationality = $params['birthnationality'];
                 $customer->vat = $params['vat'];
                 $customer->taxpayernumber = $params['taxpayernumber'];
                 $customer->type_id = !empty($params['company_type_id']) ? $params['company_type_id'] : NULL;
                 $customer->legalform_id = $params['legalform'];
                 $customer->gender = $params['gender'];
                 // Save the data
                 $customer->save();
                 $id = is_numeric($id) ? $id : $customer->getIncremented();
                 // Manage the address of the customer
                 $address = new Addresses();
                 $mainAddress = $address->findOneByUserId($id);
                 if ($mainAddress) {
                     $address = $mainAddress;
                 }
                 $address->address = $params['address'];
                 $address->city = $params['city'];
                 $address->code = $params['code'];
                 $address->country_id = $params['country_id'];
                 $address->area = $params['area'];
                 $address->customer_id = $id;
                 $address->save();
                 if (!empty($params['contact'])) {
                     $contacts = new Contacts();
                     $contacts->contact = $params['contact'];
                     $contacts->type_id = $params['contacttypes'];
                     $contacts->customer_id = $id;
                     $contacts->save();
                 }
                 // Add or Remove the customer email in the newsletter list
                 Customers::newsletter_subscription($id, $params['newsletter']);
                 $retval = Shineisp_Commons_Utilities::getEmailTemplate('profile_changed');
                 if ($retval) {
                     $subject = $retval['subject'];
                     $subject = str_replace("[user]", $params['firstname'] . " " . $params['lastname'], $retval['subject']);
                     // Alert the administrator about the changing of the customer information
                     $body = $retval['template'];
                     $body = str_replace("[user]", $params['firstname'] . " " . $params['lastname'], $body);
                     $body = str_replace("[old]", print_r($oldCustomer, true), $body);
                     $body = str_replace("[new]", print_r($customer->toArray(), true), $body);
                     $isp = Shineisp_Registry::get('ISP');
                     Shineisp_Commons_Utilities::SendEmail($isp->email, $isp->email, null, $subject, $body);
                 }
             }
         } catch (Exception $e) {
             echo $e->getMessage();
             die;
         }
         return $this->_helper->redirector('account', 'profile', 'default', array('mex' => 'The task requested has been executed successfully.', 'status' => 'success'));
     } else {
         $this->view->form = $form;
         $this->view->title = $this->translator->translate("Profile details");
         $this->view->description = $this->translator->translate("Update here your details filling the applicant form with all the information about you.");
         return $this->_helper->viewRenderer('applicantform');
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:91,代码来源:ProfileController.php

示例6: renewdomains

 /**
  * renewdomainAction
  * Renew a group of domains selected
  * @param $items
  * @return void
  */
 private function renewdomains($items)
 {
     $mex = "";
     if (is_array($items)) {
         try {
             $Orderid = Orders::createOrderWithMultiProducts($items, $this->customer['customer_id']);
             $isp = Shineisp_Registry::get('ISP');
             $order = Orders::getAllInfo($Orderid, null, true);
             $link = Fastlinks::findlinks($Orderid, $this->customer['customer_id'], 'orders');
             $retval = Shineisp_Commons_Utilities::getEmailTemplate('new_order');
             if ($retval) {
                 $subject = $retval['subject'];
                 $subject = str_replace("[orderid]", sprintf("%03s", $Orderid) . " - " . Shineisp_Commons_Utilities::formatDateOut($order[0]['order_date']), $subject);
                 $orderbody = $retval['template'];
                 $orderbody = str_replace("[fullname]", $order[0]['Customers']['firstname'] . " " . $order[0]['Customers']['lastname'], $orderbody);
                 $orderbody = str_replace("[bank]", $isp->bankname . "\nc/c:" . $isp->bankaccount . "\nIBAN: " . $isp->iban . "\nBIC: " . $isp->bic, $orderbody);
                 $orderbody = str_replace("[orderid]", $Orderid . "/" . date('Y'), $orderbody);
                 $orderbody = str_replace("[email]", $isp->email, $orderbody);
                 $orderbody = str_replace("[signature]", $isp->company . "\n" . $isp->email, $orderbody);
                 if (!empty($link[0])) {
                     $orderbody = str_replace("[url]", "http://" . $_SERVER['HTTP_HOST'] . "/index/link/id/" . $link[0]['code'], $orderbody);
                 } else {
                     $orderbody = str_replace("[url]", "http://" . $_SERVER['HTTP_HOST'], $orderbody);
                 }
                 if (!empty($order[0]['Customers']['email'])) {
                     Shineisp_Commons_Utilities::SendEmail($isp->email, $order[0]['Customers']['email'], $isp->email, $subject, $orderbody);
                 }
             }
             die(json_encode(array('reload' => '/orders/edit/id/' . $Orderid)));
         } catch (Exception $e) {
             die(json_encode(array('mex' => $e->getMessage())));
         }
     }
     return false;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:41,代码来源:DomainsController.php

示例7: dopasswordAction

 /**
  * Execute the request of the admin user to change the password
  */
 public function dopasswordAction()
 {
     $code = $this->getRequest()->getParam('id');
     $user = AdminUser::checkMD5CredencialsByIspEmail($code);
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     $form = new Admin_Form_PasswordForm(array('action' => '/admin/login/password', 'method' => 'post'));
     if (!empty($user)) {
         $isp = Isp::getActiveISP();
         // Get the template from the main email template folder
         $retval = Shineisp_Commons_Utilities::getEmailTemplate('isp_password_changed');
         $newpassword = AdminUser::resetPassword($user['user_id']);
         if (!empty($retval)) {
             $subject = $retval['subject'];
             $template = $retval['template'];
             $subject = str_replace("[lastname]", $user['lastname'], $subject);
             $template = str_replace("[lastname]", $user['lastname'], $template);
             $template = str_replace("[admin_url]", "http://" . $_SERVER['HTTP_HOST'] . "/admin/", $template);
             $template = str_replace("[email]", $user['email'], $template);
             $template = str_replace("[password]", $newpassword, $template);
             $template = str_replace("[signature]", $isp['company'], $template);
             Shineisp_Commons_Utilities::SendEmail($user['email'], $user['email'], null, $subject, $template);
             $this->view->message = $translator->translate('An email has been sent with the new login credentials');
         }
     }
     $this->view->passwordform = $form;
     return $this->render('password');
     // re-render the login form
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:31,代码来源:LoginController.php

示例8: checkTickets

 /**
  * This batch has been created in order to remind customers
  * that one or more tickets are still open.
  */
 public static function checkTickets()
 {
     $isp = Isp::getActiveISP();
     $tickets = Tickets::getWaitingReply();
     // Get the template from the main email template folder
     $retval = Shineisp_Commons_Utilities::getEmailTemplate('ticket_waitreply');
     foreach ($tickets as $ticket) {
         $customer = $ticket['Customers'];
         // Get the fastlink attached
         $link_exist = Fastlinks::findlinks($ticket['ticket_id'], $customer['customer_id'], 'tickets');
         if (count($link_exist) > 0) {
             $fastlink = $link_exist[0]['code'];
         } else {
             $fastlink = Fastlinks::CreateFastlink('tickets', 'edit', json_encode(array('id' => $ticket['ticket_id'])), 'tickets', $ticket['ticket_id'], $customer['customer_id']);
         }
         $customer_url = "http://" . $_SERVER['HTTP_HOST'] . "/index/link/id/{$fastlink}";
         if ($retval) {
             $subject = $retval['subject'];
             $Template = nl2br($retval['template']);
             $subject = str_replace("[subject]", $ticket['subject'], $subject);
             $Template = str_replace("[subject]", $ticket['subject'], $Template);
             $Template = str_replace("[lastname]", $customer['lastname'], $Template);
             $Template = str_replace("[issue_number]", $ticket['ticket_id'], $Template);
             $Template = str_replace("[date_open]", Shineisp_Commons_Utilities::formatDateOut($ticket['date_open']), $Template);
             $Template = str_replace("[link]", $customer_url, $Template);
             $Template = str_replace("[signature]", $isp['company'] . "<br/>" . $isp['website'], $Template);
             Shineisp_Commons_Utilities::SendEmail($isp['email'], Contacts::getEmails($customer['customer_id']), null, $subject, $Template, true);
         }
     }
     return true;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:35,代码来源:Tickets.php

示例9: optIn

 public static function optIn($email)
 {
     if (Shineisp_Commons_Utilities::isEmail($email)) {
         // Check if the email is already registered
         $retval = Doctrine::getTable('NewslettersSubscribers')->findOneBy('email', $email);
         if (empty($retval)) {
             // Save the new email address
             $subscriber = new NewslettersSubscribers();
             $subscriber->email = $email;
             $subscriber->subscriptiondate = date('Y-m-d H:i:s');
             if ($subscriber->trySave()) {
                 // Send the email to confirm the subscription
                 $retval = Shineisp_Commons_Utilities::getEmailTemplate('new_subscriber');
                 if ($retval) {
                     $subject = $retval['subject'];
                     $template = $retval['template'];
                     $isp = Isp::getActiveISP();
                     $template = str_replace("[signature]", $isp['company'], $template);
                     Shineisp_Commons_Utilities::SendEmail($isp['email'], $email, null, $subject, $template);
                 }
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:26,代码来源:NewslettersSubscribers.php


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