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


PHP Gems_Loader::getMail方法代码示例

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


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

示例1: sendMail

 /**
  * Send an e-mail to this user
  *
  * @param string $subjectTemplate A subject template in which {fields} are replaced
  * @param string $bbBodyTemplate A BB Code body template in which {fields} are replaced
  * @param boolean $useResetFields When true get a reset key for this user
  * @param string $locale Optional locale
  * @return mixed String or array of warnings when something went wrong
  */
 public function sendMail($subjectTemplate, $bbBodyTemplate, $useResetFields = false, $locale = null)
 {
     if ($useResetFields && !$this->canResetPassword()) {
         return $this->_('Trying to send a password reset to a user that cannot be reset.');
     }
     $mail = $this->loader->getMail();
     $mail->setTemplateStyle($this->getBaseOrganization()->getStyle());
     $mail->setFrom($this->getFrom());
     $mail->addTo($this->getEmailAddress(), $this->getFullName(), $this->project->getEmailBounce());
     if ($bcc = $this->project->getEmailBcc()) {
         $mail->addBcc($bcc);
     }
     if ($useResetFields) {
         $fields = $this->getResetPasswordMailFields($locale);
     } else {
         $fields = $this->getMailFields($locale);
     }
     // \MUtil_Echo::track($fields, $bbBodyTemplate);
     $fields = \MUtil_Ra::braceKeys($fields, '{', '}');
     $mail->setSubject(strtr($subjectTemplate, $fields));
     $mail->setBodyBBCode(strtr($bbBodyTemplate, $fields));
     try {
         $mail->send();
         return null;
     } catch (\Exception $e) {
         return array($this->_('Unable to send e-mail.'), $e->getMessage());
     }
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:37,代码来源:User.php

示例2: send

 /**
  * Send the mail
  */
 public function send()
 {
     $mail = $this->loader->getMail();
     $mail->setFrom($this->from);
     $mail->addTo($this->to, '', $this->bounceCheck());
     if (isset($this->project->email['bcc'])) {
         $mail->addBcc($this->project->email['bcc']);
     }
     $mail->setSubject($this->applyFields($this->subject));
     $mail->setTemplateStyle($this->getTemplateStyle());
     if ($this->bodyBb) {
         $mail->setBodyBBCode($this->applyFields($this->bodyBb));
     } elseif ($this->bodyHtml) {
         $mail->setBodyHtml($this->applyFields($this->bodyHtml));
     } elseif ($this->bodyText) {
         $mail->setBodyText($this->applyFields($this->bodyText));
     }
     $this->beforeMail();
     $mail->send();
     $this->afterMail();
 }
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:24,代码来源:MailerAbstract.php


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