gravityhopper-et/color_base

Description

Filters the base color for use in templates which is set at Forms → Settings → Email Templates

Usage

Filter the default base color.

add_filter( 'gravityhopper-et/color_base', 'my_callback_function', 10, 3 );

Parameters

color : string

Hex color to be used as base for branding templates. Default is value set at Forms → Settings → Email Templates

template_slug : string

Slug of the email template being applied to the notification.

payload : array

Keyed array containing objects for notification, form, and entry.

Examples

Set base color specific to notifications

add_filter( 'gravityhopper-et/color_base', function( $color, $template_slug, $payload ) {

    switch ( rgars( $payload, 'notification/id' ) ) {
        case '65f8774543ae3':   return '#e27b30';   break;
        case '65f8ff3f7555c':   return '#f3b551';   break;
        default:                return $color;      break;
    }

}, 10, 3 );