public function getTemplateData($context, $user = null, $extraData = [])
    {
        // useful global data
        $data = [
            'ThemeDirs' => new ArrayList(SSViewer::get_themes()),
            'SiteConfig' => SiteConfig::current_site_config(),
        ];

        // the context object, keyed by it's class name
        $clsPath = explode('\\', get_class($context));
        $data[end($clsPath)] = $context;
        $data['Context'] = $context;

        // data as defined by the context object
        $contextData = method_exists($context, 'getNotificationTemplateData') ? $context->getNotificationTemplateData() : null;
        if (is_array($contextData)) {
            $data = array_merge($data, $contextData);
        }

        // the member the notification is being sent to
        $data['Member'] = $user;

        // extra data
        $data = array_merge($data, $extraData);

        return ArrayData::create($data);
    }
public function getTemplateData($context, $user = null, $extraData = [])
    {
        // useful global data
        $data = [
            'ThemeDirs' => new ArrayList(SSViewer::get_themes()),
            'SiteConfig' => SiteConfig::current_site_config(),
        ];

        // the context object, keyed by it's class name
        $clsPath = explode('\\', get_class($context));
        $data[end($clsPath)] = $context;
        $data['Context'] = $context;

        // data as defined by the context object
        $contextData = method_exists($context, 'getNotificationTemplateData') ? $context->getNotificationTemplateData() : null;
        if (is_array($contextData)) {
            $data = array_merge($data, $contextData);
        }

        // the member the notification is being sent to
        $data['Member'] = $user;

        // extra data
        $data = array_merge($data, $extraData);

        return ArrayData::create($data);
    }
public function getTemplateData ( $ context , $ user = null , $ extraData = [ ] ) { // useful global data $ data = [ 'ThemeDirs' => new ArrayList ( SSViewer :: get_themes ( ) ) , 'SiteConfig' => SiteConfig :: current_site_config ( ) , ] ; // the context object, keyed by it's class name $ clsPath = explode ( '\\' , get_class ( $ context ) ) ; $ data [ end ( $ clsPath ) ] = $ context ; $ data [ 'Context' ] = $ context ; // data as defined by the context object $ contextData = method_exists ( $ context , 'getNotificationTemplateData' ) ? $ context -> getNotificationTemplateData ( ) : null ; if ( is_array ( $ contextData ) ) { $ data = array_merge ( $ data , $ contextData ) ; } // the member the notification is being sent to $ data [ 'Member' ] = $ user ; // extra data $ data = array_merge ( $ data , $ extraData ) ; return ArrayData :: create ( $ data ) ; }
Get compiled template data to render a string with
@param  NotifiedOn $context
@param  Member     $user
@param  array      $extraData
@return ArrayData
Get compiled template data to render a string with