PHP code example of unclecheese / silverstripe-permamail

1. Go to this page and download the library: Download unclecheese/silverstripe-permamail 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/ */

    

unclecheese / silverstripe-permamail example snippets


$e = Email::create()
 	->setFrom('[email protected]')
 	->toMembers(Member::get())
 	->setSubject('Test email')
 	->setUserTemplate('my-template')
 	->populateTemplate(array(
 		'Member' => Member::get()->byID(2)
 	))
 	->send();