PHP code example of rixxi / mail-message-template
1. Go to this page and download the library: Download rixxi/mail-message-template library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rixxi / mail-message-template example snippets
$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('[email protected]');
$this->sender->send($message);
\\ ...