1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2025-01-31 20:11:38 +01:00

Implement configuration file for default subscriptions (fixes #294)

This commit is contained in:
Moritz Marquardt 2021-11-30 17:46:18 +01:00
parent 3f17e9b811
commit 038c3610ac
No known key found for this signature in database
GPG Key ID: D5788327BEE388B6
2 changed files with 32 additions and 18 deletions

View File

@ -49,23 +49,6 @@ class Subscription extends Model
self::MEDIUM_MOBILE,
];
public static $default_subscriptions = [
self::MEDIUM_EMAIL => [
self::EVENT_CONVERSATION_ASSIGNED_TO_ME,
self::EVENT_FOLLOWED_CONVERSATION_UPDATED,
//self::EVENT_MY_TEAM_MENTIONED,
self::EVENT_CUSTOMER_REPLIED_TO_MY,
self::EVENT_USER_REPLIED_TO_MY,
],
self::MEDIUM_BROWSER => [
self::EVENT_CONVERSATION_ASSIGNED_TO_ME,
self::EVENT_FOLLOWED_CONVERSATION_UPDATED,
//self::EVENT_MY_TEAM_MENTIONED,
self::EVENT_CUSTOMER_REPLIED_TO_MY,
self::EVENT_USER_REPLIED_TO_MY,
],
];
/**
* List of events that occured.
*/
@ -95,7 +78,7 @@ class Subscription extends Model
*/
public static function addDefaultSubscriptions($user_id)
{
self::saveFromArray(self::$default_subscriptions, $user_id);
self::saveFromArray(\Config::get('subscriptions.defaults'), $user_id);
}
/**

31
config/subscriptions.php Normal file
View File

@ -0,0 +1,31 @@
<?php
return [
/*
|-------------------
| Default Notification Subscriptions
|----------------------
|
| This file is for configuring the default notification subscriptions for new users.
|
*/
'defaults' => [
\App\Subscription::MEDIUM_EMAIL => [
\App\Subscription::EVENT_CONVERSATION_ASSIGNED_TO_ME,
\App\Subscription::EVENT_FOLLOWED_CONVERSATION_UPDATED,
//\App\Subscription::EVENT_MY_TEAM_MENTIONED,
\App\Subscription::EVENT_CUSTOMER_REPLIED_TO_MY,
\App\Subscription::EVENT_USER_REPLIED_TO_MY,
],
\App\Subscription::MEDIUM_BROWSER => [
\App\Subscription::EVENT_CONVERSATION_ASSIGNED_TO_ME,
\App\Subscription::EVENT_FOLLOWED_CONVERSATION_UPDATED,
//\App\Subscription::EVENT_MY_TEAM_MENTIONED,
\App\Subscription::EVENT_CUSTOMER_REPLIED_TO_MY,
\App\Subscription::EVENT_USER_REPLIED_TO_MY,
],
],
];