Filter the CSS styles used in Alpha Insights email templates before they are output in the <style> tag.
Email templates include inline styles for compatibility with email clients. The plugin builds a string of CSS and outputs it inside a <style type="text/css"> block. This filter receives that CSS string so you can add or override styles (e.g. brand colors, fonts, or layout). The filtered value is escaped with esc_html() when output.
File: includes/emails/wpd-email-template_styles.php
Context: Before the style block is echoed into the email template.
| Parameter | Type | Description |
|---|---|---|
| $email_styles | string | The CSS content for the email template (rules and declarations) |
Type: string
The (possibly modified) CSS string. Keep valid CSS; the output is escaped for HTML context.
add_filter( 'wpdai_email_template_styles', 'add_brand_email_styles' );
function add_brand_email_styles( $email_styles ) {
$extra = '
.wpd-email-header { background-color: #1a1a2e !important; }
.wpd-email-button { background-color: #e94560 !important; }
';
return $email_styles . $extra;
}
add_filter( 'wpdai_email_template_styles', 'override_email_font' );
function override_email_font( $email_styles ) {
$email_styles = str_replace( 'font-family: sans-serif', 'font-family: "Helvetica Neue", Helvetica, Arial, sans-serif', $email_styles );
return $email_styles;
}