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


PHP Message::body方法代码示例

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


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

示例1: send

 public function send($template, $data, $callback)
 {
     //Nova instanca Mailgun Messagebuildera koji sluzi za pravljenje emailova
     $builder = $this->mailer->MessageBuilder();
     //Kreiramo instancu Message k. da bi mogli poslati body od email,a arg. constuctora $builder,omogucava da se metode
     //iz Message k. izvrse. Message k. ne treba importovati zato sto se nalazi u istom folderu kao i Mailer k.
     $message = new Message($builder);
     //Nastimavamo od koga je poruka sa setFromAddress(),a iz konfiguracije dohvatamo email adresu od koga se salje poruka
     $message->from($this->config->get('mail.from'));
     //Dodajemo $data na view koji smo propustili kao param. u register.php ('email/auth/registered.php'),a to su korinsicki
     //podatci,tako da su ti korisnicki podatci dostupni i šerovani na views-u i da se mogu koristiti unutar Twiga
     $this->view->appendData($data);
     //Dodajemo tijelo email-a tj. poruku sa tekstom body,uz pomoc body() m. iz Message klase,u koji propustamo $template arg.
     //koji ce onda otici na register.php i preuzeti views ('email/auth/registered.php') i uz pomoc render() metoda poslati ga
     //kao tijelo emila
     $message->body($this->view->render($template));
     //Pozivamo callback funkciju sa register.php zajedno sa $message = new Message($this->mailer); da bi mogli koristiti
     //Message metode. callback func. uzima param. $message i onda prilikom svog izvrsavanje koristi to() i subject() m.
     call_user_func($callback, $message);
     //Dohvatamo domenu od Mailguna zato sto cemo slati POST request kroz Milgun API
     $domain = $this->config->get('mail.domain');
     //Slanje email poruke (getMessage() m. je iz Mailguna i sluzi sa dohvatanje email poruke,a post() sluzi sa slanje emaila)
     //"{$domain}/messages" se odnosi na nasu domenu na Mailgun st. i messages view tj. poruke na toj st.
     $this->mailer->post("{$domain}/messages", $builder->getMessage());
 }
开发者ID:retro12,项目名称:Slim-CMS,代码行数:25,代码来源:Mailer.php

示例2: send

 public function send($template, $data, $callback)
 {
     $message = new Message($this->mailer);
     $message->body($this->load->view($template, $data, true));
     call_user_func($callback, $message);
     return $this->mailer->send();
 }
开发者ID:karsanrichard,项目名称:zerotech,代码行数:7,代码来源:Mailer.php

示例3: notice

 public function notice($body, $data, $callback)
 {
     $message = new Message($this->email);
     $message->body($body);
     $message->from($this->from);
     call_user_func($callback, $message);
     $this->sendgrid->send($this->email);
 }
开发者ID:abhisuri97,项目名称:SoHacks_registration_system,代码行数:8,代码来源:Mailer.php

示例4: send

 public function send($template, $data, $callback)
 {
     $message = new Message($this->mailer);
     $this->view->appendData($data);
     $message->body($this->view->render($template));
     call_user_func($callback, $message);
     $this->mailer->send();
 }
开发者ID:blrik,项目名称:bHome,代码行数:8,代码来源:Mailer.php

示例5: send

 public function send($template, $data, $callback)
 {
     $message = new Message($this->mailer);
     $this->mailer->From = "biuro@elephpant.pl";
     $this->mailer->FromName = "elePHPant";
     $this->view->appendData($data);
     $message->body($this->view->render($template));
     call_user_func($callback, $message);
     $this->mailer->send();
 }
开发者ID:23Games-Abandoned,项目名称:elePHPant.CMF,代码行数:10,代码来源:Mailer.php

示例6: send

 public function send($template, $data, $callback)
 {
     $builder = $this->mailer->MessageBuilder();
     $message = new Message($builder);
     $message->from($this->config->get('mail.from'), $this->config->get('mail.from_name'));
     $this->view->appendData($data);
     $message->body($this->view->render($template));
     call_user_func($callback, $message);
     $domain = $this->config->get('mail.domain');
     $this->mailer->post("{$domain}/messages", $builder->getMessage());
 }
开发者ID:owency,项目名称:Owency,代码行数:11,代码来源:Mailer.php

示例7: send

 public function send($template, $data, $cb)
 {
     $message = new Message($this->mailer);
     $message->body($this->view->render($template, $data));
     call_user_func($cb, $message);
     if (!$this->mailer->send()) {
         die('Mailer Error: ' . $this->mailer->ErrorInfo);
     } else {
         echo "Success sending email";
     }
 }
开发者ID:dewey92,项目名称:slim3-starter,代码行数:11,代码来源:Mailer.php

示例8: send

 public function send($template, $data, $callback)
 {
     $message = new Message($this->mailer);
     $this->view->appendData($data);
     $message->body($this->view->render($template));
     call_user_func($callback, $message);
     // Remember to 'Allow less secure apps' in Google's security settings when testing
     if (!$this->mailer->send()) {
         echo "Mailer Error: " . $this->mailer->ErrorInfo;
         exit;
     }
 }
开发者ID:blogscot,项目名称:slim-authentication,代码行数:12,代码来源:Mailer.php

示例9: send

 public function send($template, $data, $callback)
 {
     $message = new Message($this->mailer);
     $this->view->appendData($data);
     $message->body($this->view->render($template));
     call_user_func($callback, $message);
     if (!$this->mailer->Send()) {
         return "Mailer Error: " . $mailer->ErrorInfo;
     } else {
         return "Message sent!";
     }
 }
开发者ID:rasmusrosengren,项目名称:CAS,代码行数:12,代码来源:Mailer.php

示例10: send

 public function send($template, $data, $callback)
 {
     $message = new Message($this->mailer);
     $this->view->appendData($data);
     $message->body($this->view->render($template));
     call_user_func($callback, $message);
     $this->mailer->From = 'test@yannickweb.de';
     //change
     $this->mailer->FromName = 'No Reply';
     //change
     $this->mailer->send();
 }
开发者ID:Nut,项目名称:php-login,代码行数:12,代码来源:Mailer.php

示例11: send

 public function send($template, $data, $callback)
 {
     $message = new Message($this->mailer);
     $this->view->appendData($data);
     $message->body($this->view->render($template));
     call_user_func($callback, $message);
     try {
         $this->mailer->send();
     } catch (\Exception $e) {
         var_dump($e);
         die;
     }
 }
开发者ID:JenuJari,项目名称:slim_auth,代码行数:13,代码来源:Mailer.php

示例12: send

 public function send($template, $data, $callback)
 {
     $this->errors = null;
     $message = new Message($this->mailer);
     $this->view->appendData($data);
     $message->body($this->view->render($template));
     call_user_func($callback, $message);
     if (!$this->mailer->send()) {
         $this->errors = $this->mailer->ErrorInfo;
         return FALSE;
     } else {
         return TRUE;
     }
 }
开发者ID:tawazz,项目名称:spendee,代码行数:14,代码来源:mail.php

示例13: send

 public function send($template, $data, $callback)
 {
     try {
         $message = new Message($this->mailer);
         $this->view->appendData($data);
         $message->body($this->view->render($template));
         call_user_func($callback, $message);
         $this->mailer->send();
     } catch (phpmailerException $e) {
         echo $e->errorMessage();
         //error messages from PHPMailer
     } catch (Exception $e) {
         echo $e->getMessage();
     }
 }
开发者ID:aankittcoolest,项目名称:lunchbox,代码行数:15,代码来源:Mailer.php


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