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


PHP EmailTemplate::setFrom方法代码示例

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


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

示例1: eventSendEmailAlert

 function eventSendEmailAlert(EventControler $event_controler)
 {
     if ($this->email_alert == 'y') {
         $fields = $event_controler->fields;
         $do_contact = $event_controler->do_contact;
         $fields_content_html = '';
         $fields_content_text = '';
         foreach ($fields as $field_name => $field_value) {
             if (strlen($field_value) > 0 && strlen($field_name) > 0) {
                 $fields_content_html .= '<br>' . $field_name . ': ' . $field_value;
                 $fields_content_text .= "\n" . $field_name . ": " . $field_value;
             }
         }
         $email_values['fields_content_html'] = $fields_content_html;
         $email_values['fields_content_text'] = $fields_content_text;
         $email_values['firstname'] = $do_contact->firstname;
         $email_values['webformname'] = $this->title;
         $email_values['contact_url'] = $GLOBALS['cfg_ofuz_site_http_base'] . 'Contact/' . $do_contact->idcontact;
         $email_template = new EmailTemplate("web form email alert");
         $do_user = new User();
         $do_user->getId($this->iduser);
         $do_contact_email = $do_contact->getChildContactEmail();
         $contact_email = $do_contact_email->getDefaultEmail();
         if (strlen($contact_email) < 3) {
             $contact_email = $GLOBALS['cfg_ofuz_email_support'];
         }
         $this->setLog("\n Sending webform alert to: " . $do_user->getFullName() . " with " . $do_user->email . " for new contact:" . $do_contact->firstname);
         $email_template->setFrom($contact_email, $do_contact->firstname . " " . $do_contact->lastname);
         $do_user->sendMessage($email_template, $email_values);
     }
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:31,代码来源:WebFormUser.class.php

示例2: eventSendPortalAlert

 /** 
  *   eventSendPortalAlert
  *   This event is triggered when adding a note in a contact 
  *   It will send a copy of the note the contact.
  */
 function eventSendPortalAlert(EventControler $event_controler)
 {
     $this->setLog("eventSendPortalAlert starting (" . date("Y/m/d H:i:s") . ")");
     $do_contact_email = $_SESSION['do_contact']->getChildContactEmail();
     $email_to = $do_contact_email->getDefaultEmail();
     $this->setLog("\nDocument in note: " . $_SESSION['ContactNoteEditSave']->document);
     if (strlen($_SESSION['ContactNoteEditSave']->document) > 0) {
         // If a file is attached
         $doc_link = $GLOBALS['cfg_ofuz_site_http_base'] . 'files/' . $_SESSION['ContactNoteEditSave']->document;
         $doc_name = $_SESSION['ContactNoteEditSave']->document;
         $this->setLog("\n Document set to: " . $doc_name . " url:" . $doc_link);
     } else {
         $doc_name = '';
         $doc_link = '';
     }
     $contact_link = $GLOBALS['cfg_ofuz_site_http_base'] . 'Contact/' . $_SESSION['do_contact']->idcontact;
     $contact_name = $_SESSION['do_contact']->firstname . " " . $_SESSION['do_contact']->lastname;
     $this->setLog("\nWe send a message from:" . $email_to);
     if (strlen($email_to) > 4) {
         $template = new EmailTemplate("ofuz portal alert");
         $template->setFrom($email_to, $contact_name);
         $content = array('note_html' => nl2br(htmlentities($_SESSION['ContactNoteEditSave']->note)), 'note_text' => $_SESSION['ContactNoteEditSave']->note, 'doc_name' => $doc_name, 'doc_link' => $doc_link, 'contact_link' => $contact_link, 'contact_name' => $contact_name);
         $this->sendMessage($template, $content);
     }
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:30,代码来源:User.class.php


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