Email doc formatting

Workaround markdown parser throwing a fit with code straight after list.
This commit is contained in:
Will Rossiter 2012-12-04 20:00:09 +13:00
parent bf67679155
commit 100ad658db

View File

@ -39,6 +39,8 @@ The default HTML template is located in `framework/templates/email/GenericEmail.
* Choose your template with **setTemplate()**
* Populate any custom data into the template before sending with **populateTemplate()**
Example:
:::php
$email = new Email($from, $to, $subject, $body);
$email->setTemplate('MyEmail');
@ -47,6 +49,7 @@ The default HTML template is located in `framework/templates/email/GenericEmail.
$email->populateTemplate(Member::currentUser());
$welcomeMsg = 'Thank you for joining on '.date('Y-m-d'.'!');
$email->populateTemplate(array(
'WelcomeMessage' => $welcomeMsg, // Accessible in template via $WelcomeMessage
));
@ -54,7 +57,6 @@ The default HTML template is located in `framework/templates/email/GenericEmail.
$email->send();
### Subclassing
Class definition:
@ -67,7 +69,6 @@ Class definition:
$from = 'email@email.com',
$ss_template = 'MyEmail';
}
?>
Usage:
@ -77,7 +78,6 @@ Usage:
$email = new MyEmail();
$email->populateTemplate(Member::currentUser()); // This will populate the template, $to, $from etc variables if they exist
$email->send(); // Will immediately send an HTML email with appropriate plain-text content
?>
### Administrator Emails