SproutCMS

This is the code documentation for the SproutCMS project

class Email

Sends emails using HTML content generated by a View, wrapped in a standard template

Example

$view = new View('modules/MyModule/welcome_email');
$view->set(...);
 
$mail = new Email();
$mail->Subject = 'Talking about the things and stuff';
$mail->addAddress('example@example.org', 'Elaine Exemplary');
$mail->SkinnedHTML($view);
$mail->send();

Extending this class

<?php
/**
* New class description goes here
* 
* @author Your Name, 2026-08-16
**/
class NewClassName extends Email {
    
    /**
    * Sets the message content to be the specified content, with the email skin around it
    * Content can either be a HTML string or a View.
    **/
    public function SkinnedHTML (string|View $content, array $extraparams, string $template) {
        // Method code goes here
    }
    
    public function __construct () {
        // Method code goes here
    }
    
}
?>