PHP code example of lekoala / silverstripe-foundation-emails
1. Go to this page and download the library: Download lekoala/silverstripe-foundation-emails 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/ */
lekoala / silverstripe-foundation-emails example snippets
$email = new Email();
$email->addData([
'EmailContent' => 'Here is my body',
'Callout' => 'Here is my callout',
'Sidebar' => 'Here is my sidebar',
'HeroImage' => Image::get()->first()
]);
$email = new Email();
$viewer = new SSViewer('MyEmailTemplate');
$result = $viewer->process($this);
$email->addData(['EmailContent' => (string) $result]);
Dear Customer,<br/><br/>
Please find your password reset link:<br/><br/>
$FoundationButton('Reset your passowrd', $PasswordResetLink)