當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Message::addReplyTo方法代碼示例

本文整理匯總了PHP中Nette\Mail\Message::addReplyTo方法的典型用法代碼示例。如果您正苦於以下問題:PHP Message::addReplyTo方法的具體用法?PHP Message::addReplyTo怎麽用?PHP Message::addReplyTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Nette\Mail\Message的用法示例。


在下文中一共展示了Message::addReplyTo方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addReplyTo

 /**
  * @param string $email
  * @param string $name
  */
 public function addReplyTo($email, $name = null)
 {
     try {
         $this->message->addReplyTo($email, $name);
     } catch (\Exception $e) {
         throw new MailerException($e->getMessage());
     }
 }
開發者ID:rukzuk,項目名稱:rukzuk,代碼行數:12,代碼來源:Mailer.php

示例2: send

 /**
  * @param string $view email template
  * @param User $user
  * @param NULL|array $args template variables
  *
  * @throws Exception from Latte\Engine
  * @throws SmtpException from Mailer
  */
 public function send($view, User $user, array $args = [])
 {
     if ($this->orm->unsubscribes->getByEmail($user->email)) {
         // Last line of defense. Make sure unsubscribed users
         // really dont receive any email. This should however
         // be handled before the task is queued.
         $this->logger->addAlert("Email to '{$user->email}' not send, user unsubscribed. Find out why it was queued");
         return;
     }
     $msg = new Message();
     $msg->setFrom('Khanova škola <reply@khanovaskola.cz>');
     $msg->addReplyTo('Markéta Matějíčková <marketa@khanovaskola.cz>');
     $msg->addTo($user->email, $user->name);
     $token = Unsubscribe::createFromUser($user);
     $token->emailType = $view;
     $this->orm->tokens->attach($token);
     $this->orm->flush();
     $args['recipient'] = $user;
     $args['email'] = $msg;
     $args['unsubscribe'] = (object) ['token' => $token, 'code' => $token->getUnsafe()];
     $args['baseUrl'] = rtrim($this->baseUrl, '/');
     $latte = new Engine();
     /** @var Presenters\Token $presenter */
     $presenter = $this->factory->createPresenter('Token');
     $presenter->autoCanonicalize = FALSE;
     $ref = new \ReflectionProperty(Presenter::class, 'globalParams');
     $ref->setAccessible(TRUE);
     $ref->setValue($presenter, []);
     $latte->addFilter('token', function (Token $token, $unsafe) use($presenter, $view) {
         return $presenter->link('//Token:', ['token' => $token->toString($unsafe), 'utm_campaign' => "email-{$view}"]);
     });
     $latte->addFilter('vocative', function ($phrase) {
         return $this->inflection->inflect($phrase, 5);
     });
     $template = $latte->renderToString($this->getTemplate($view), $args);
     $msg->setHtmlBody($template);
     $this->mailer->send($msg);
     $this->logger->addInfo('Email send', ['view' => $view, 'email' => $user->email]);
 }
開發者ID:VasekPurchart,項目名稱:khanovaskola-v3,代碼行數:47,代碼來源:Mailer.php

示例3: addReplyTo

 function addReplyTo($args)
 {
     $this->Message->addReplyTo($args);
 }
開發者ID:profectsro,項目名稱:mailgun-mailer,代碼行數:4,代碼來源:MailgunMailer.php


注:本文中的Nette\Mail\Message::addReplyTo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。