SettingsController::getTestEmail PHP Метод

getTestEmail() публичный Метод

Sets up a new Gdn_Email object with a test email.
public getTestEmail ( string $image = '', string $textColor = '', string $backGroundColor = '', string $containerBackgroundColor = '', string $buttonTextColor = '', string $buttonBackgroundColor = '' ) : Gdn_Email
$image string The img src of the previewed image
$textColor string The hex color code of the text.
$backGroundColor string The hex color code of the background color.
$containerBackgroundColor string The hex color code of the container background color.
$buttonTextColor string The hex color code of the link color.
$buttonBackgroundColor string The hex color code of the button background.
Результат Gdn_Email The email object with the test colors set.
    public function getTestEmail($image = '', $textColor = '', $backGroundColor = '', $containerBackgroundColor = '', $buttonTextColor = '', $buttonBackgroundColor = '')
    {
        $emailer = new Gdn_Email();
        $email = $emailer->getEmailTemplate();
        if ($image) {
            $email->setImage($image);
        }
        if ($textColor) {
            $email->setTextColor($textColor);
        }
        if ($backGroundColor) {
            $email->setBackgroundColor($backGroundColor);
        }
        if ($backGroundColor) {
            $email->setContainerBackgroundColor($containerBackgroundColor);
        }
        if ($buttonTextColor) {
            $email->setDefaultButtonTextColor($buttonTextColor);
        }
        if ($buttonBackgroundColor) {
            $email->setDefaultButtonBackgroundColor($buttonBackgroundColor);
        }
        $message = t('Test Email Message');
        $email->setMessage($message)->setTitle(t('Test Email'))->setButton(externalUrl('/'), t('Check it out'));
        $emailer->setEmailTemplate($email);
        return $emailer;
    }