public function triggerActivity( $slug, $data, $config = [] ) {

		// Return in case activity logging is disabled at system level.
		if( !Yii::$app->core->isActivities() ) {

			return false;
		}

		// Generate Message

		$template = $this->templateService->getBySlugType( $slug, NotifyGlobal::TYPE_ACTIVITY );

		// Do nothing if template not found or disabled
		if( empty( $template ) || !$template->isActive() ) {

			return;
		}

		$message = Yii::$app->templateManager->renderMessage( $template, $data, $config );

		// Trigger Activity

		$templateConfig = $template->getDataMeta( CoreGlobal::DATA_CONFIG );

		$model		= $data[ 'model' ];
		$gridData	= [];

		$gridData[ 'content' ]	= isset( $templateConfig->storeContent ) && $model->hasAttribute( 'content' ) ? $model->content : null;
		$gridData[ 'data' ]		= isset( $templateConfig->storeData ) && $model->hasAttribute( 'data' ) ? $model->data : null;
		$gridData[ 'cache' ]	= isset( $templateConfig->storeCache ) && $model->hasAttribute( 'cache' ) ? $model->cache : null;

		$activity = $this->activityService->getModelObject();

		$activity->userId		= $config[ 'userId' ];
		$activity->parentId		= isset( $config[ 'parentId' ] ) ? $config[ 'parentId' ] : null;
		$activity->parentType	= isset( $config[ 'parentType' ] ) ? $config[ 'parentType' ] : null;
		$activity->admin		= isset( $config[ 'admin' ] ) ? $config[ 'admin' ] : false;

		$activity->consumed	= false;
		$activity->trash	= false;

		$activity->content			= $message;
		$activity->gridCache		= json_encode(  $gridData );
		$activity->gridCacheValid	= true;
		$activity->gridCachedAt		= DateUtil::getDateTime();

		$activity->type = "log";

		if( isset( $config[ 'title' ] ) ) {

			$activity->title = $config[ 'title' ];
		}
		else {

			$activity->title = $template->name;
		}

		// Create Activity
		$this->activityService->create( $activity, $config );

		$user =	Yii::$app->user->getIdentity();

		$user->lastActivityAt = DateUtil::getDateTime();

		$user->update();
	}