2017 © Pedro Peláez
 

library mail-message-template

image

rixxi/mail-message-template

  • Tuesday, June 10, 2014
  • by mishak87
  • Repository
  • 2 Watchers
  • 2 Stars
  • 889 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 3 Open issues
  • 2 Versions
  • 5 % Grown

The README.md

Install

composer require rixxi/mail-message-template

Configure

extensions:
  rixxiMailMessageTemplate: Rixxi\Mail\DI\MessageTemplateExtension

Use

Template

Create template with subject, body and html body. All parts are optional., (*1)

{subject}Welcome to our site {$user->name}{/subject}

{body}
Oh how we are so grateful {$user->name} that you decided to join our awesome service.

Sincerly,
yours CEO
Only Man in the Company
{/body}

{body html} {* text is default *}
<marquee>Oh how we are so grateful {$user->name} that you decided to join our awesome service.<marquee>



Sincerly,
yours CEO
Only Man in the Company , (*2)

{/body}

Code

$message = $messageFactory->createFromFile(__DIR__ . '/../mails/registration.latte', array(
    'user' => (object) array(
        'name' => 'Name Surname',
    ),
));

// message will have set subject, body and its html alternative

// setup other stuff and send
$message->addTo($user->email);
$message->setFrom('example@example.com');

$this->sender->send($message);

\\ ...

Creating from file template will allow you to utilize Nette\Mail\Message auto-inlining of template content for html body. You can alternatively use createFromString for creating message from string., (*3)

The Versions

10/06 2014

dev-master

9999999-dev

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

09/06 2014

0.1.0

0.1.0.0

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires