common/services/base/ActiveRecordService.php
protected function sendNotification( $model, $config = [] ) {

		$templateData	= $config[ 'data' ] ?? [];
		$templateConfig	= [];

		$templateData	= ArrayHelper::merge( [ 'model' => $model, 'service' => $this ], $templateData );

		$templateConfig[ 'createdBy' ]	= $config[ 'createdBy' ] ?? null;
		$templateConfig[ 'parentId' ]	= $model->id;
		$templateConfig[ 'parentType' ]	= self::$parentType;
		$templateConfig[ 'link' ]		= $config[ 'link' ] ?? null;
		$templateConfig[ 'adminLink' ]	= $config[ 'adminLink' ] ?? null;

		$templateConfig[ 'title' ]	= $config[ 'title' ] ?? $model->name ?? null;
		$templateConfig[ 'users' ]	= $config[ 'users' ] ?? [];

		return Yii::$app->eventManager->triggerNotification( $config[ 'template' ], $templateData, $templateConfig );
	}
protected function sendNotification( $model, $config = [] ) {

		$templateData	= $config[ 'data' ] ?? [];
		$templateConfig	= [];

		$templateData	= ArrayHelper::merge( [ 'model' => $model, 'service' => $this ], $templateData );

		$templateConfig[ 'createdBy' ]	= $config[ 'createdBy' ] ?? null;
		$templateConfig[ 'parentId' ]	= $model->id;
		$templateConfig[ 'parentType' ]	= self::$parentType;
		$templateConfig[ 'link' ]		= $config[ 'link' ] ?? null;
		$templateConfig[ 'adminLink' ]	= $config[ 'adminLink' ] ?? null;

		$templateConfig[ 'title' ]	= $config[ 'title' ] ?? $model->name ?? null;
		$templateConfig[ 'users' ]	= $config[ 'users' ] ?? [];

		return Yii::$app->eventManager->triggerNotification( $config[ 'template' ], $templateData, $templateConfig );
	}
protected function sendNotification ( $ model , $ config = [ ] ) { $ templateData = $ config [ 'data' ] ?? [ ] ; $ templateConfig = [ ] ; $ templateData = ArrayHelper :: merge ( [ 'model' => $ model , 'service' => $ this ] , $ templateData ) ; $ templateConfig [ 'createdBy' ] = $ config [ 'createdBy' ] ?? null ; $ templateConfig [ 'parentId' ] = $ model -> id ; $ templateConfig [ 'parentType' ] = self :: $ parentType ; $ templateConfig [ 'link' ] = $ config [ 'link' ] ?? null ; $ templateConfig [ 'adminLink' ] = $ config [ 'adminLink' ] ?? null ; $ templateConfig [ 'title' ] = $ config [ 'title' ] ?? $ model -> name ?? null ; $ templateConfig [ 'users' ] = $ config [ 'users' ] ?? [ ] ; return Yii :: $ app -> eventManager -> triggerNotification ( $ config [ 'template' ] , $ templateData , $ templateConfig ) ; }
Prepare the notification data and configuration and trigger it using the active
event manager.

@param \cmsgears\core\common\models\base\ActiveRecord $model
@param array $config
@return type
Prepare the notification data and configuration and trigger it using the active event manager .