Files
STLPWebsite/config/www/user/plugins/email/classes/Utils.php
Charles N Wyble 9f7fe553dc Add premium logo and professional theme for high-end clients
- Create custom SVG logo with professional branding
- Implement premium color scheme with blue and gold accents
- Add custom CSS with professional styling for cards, tables, buttons
- Update logo template to use new logo.svg file
- Create custom favicon for complete branding
- Redesign homepage with premium content sections
- Update resources page with membership tiers and premium pricing
- Enhance contact page with testimonials and detailed information
- Target audience: high-paying clients ($100+/hour)
- Professional yet approachable design language

💘 Generated with Crush

Assisted-by: GLM-4.7 via Crush <crush@charm.land>
2026-01-13 16:15:40 -05:00

49 lines
1.2 KiB
PHP

<?php
namespace Grav\Plugin\Email;
use Grav\Common\Grav;
use Grav\Common\Twig\Twig;
use Grav\Common\Utils as GravUtils;
/**
* Class Utils
* @package Grav\Plugin\Email
*/
class Utils
{
/**
* Quick utility method to send an HTML email.
*
* @param array<int,mixed> $params
*
* @return bool True if the action was performed.
*/
public static function sendEmail(...$params)
{
if (is_array($params[0])) {
$params = array_shift($params);
} else {
$keys = ['subject', 'body', 'to', 'from', 'content_type'];
$params = GravUtils::arrayCombine($keys, $params);
}
//Initialize twig if not yet initialized
/** @var Twig $twig */
$twig = Grav::instance()['twig']->init();
/** @var Email $email */
$email = Grav::instance()['Email'];
if (empty($params['to']) || empty($params['subject']) || empty($params['body'])) {
return false;
}
$params['body'] = $twig->processTemplate('email/base.html.twig', ['content' => $params['body']]);
$message = $email->buildMessage($params);
return $email->send($message);
}
}