本文整理汇总了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());
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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());
}
示例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";
}
}
示例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;
}
}
示例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!";
}
}
示例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();
}
示例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;
}
}
示例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;
}
}
示例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();
}
}