Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -189,6 +189,12 @@ class _Notification
|
||||
*/
|
||||
protected $key;
|
||||
|
||||
/**
|
||||
* @brief Email template key
|
||||
* @note Typically this is "notification__{key}"
|
||||
*/
|
||||
protected $emailKey;
|
||||
|
||||
/**
|
||||
* @brief Item
|
||||
*/
|
||||
@@ -232,9 +238,10 @@ class _Notification
|
||||
* @param array $emailParams Data for notification emails
|
||||
* @param array $inlineExtra Extra data to save with inline notifications. Use sparingly: only in cases where it is not possible to obtain the same data later. Will be merged for duplicate notifications.
|
||||
* @param bool $allowMerging Allow two identical notification types to be merged
|
||||
* @param string|NULL $emailKey Custom email template to use, or NULL to use default
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( \IPS\Application $app, $key, $item=NULL, $emailParams=array(), $inlineExtra=array(), $allowMerging=TRUE )
|
||||
public function __construct( \IPS\Application $app, $key, $item=NULL, $emailParams=array(), $inlineExtra=array(), $allowMerging=TRUE, $emailKey=NULL )
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->key = $key;
|
||||
@@ -243,6 +250,7 @@ class _Notification
|
||||
$this->emailParams = $emailParams;
|
||||
$this->inlineExtra = $inlineExtra;
|
||||
$this->allowMerging = $allowMerging;
|
||||
$this->emailKey = ( $emailKey === NULL ) ? 'notification_' . $this->key : $emailKey;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -262,7 +270,7 @@ class _Notification
|
||||
foreach ( $this->recipients as $member )
|
||||
{
|
||||
/* Let's not send notifications to deleted members, banned members or spammers */
|
||||
if ( $member === NULL or $member->isBanned() or $member->members_bitoptions['bw_is_spammer'] )
|
||||
if ( $member === NULL or !$member->member_id or $member->isBanned() or $member->members_bitoptions['bw_is_spammer'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -336,7 +344,7 @@ class _Notification
|
||||
|
||||
if ( !isset( $emails[ $language ] ) )
|
||||
{
|
||||
$email = \IPS\Email::buildFromTemplate( $this->app->directory, 'notification_' . $this->key, $this->emailParams, \IPS\Email::TYPE_LIST );
|
||||
$email = \IPS\Email::buildFromTemplate( $this->app->directory, $this->emailKey, $this->emailParams, \IPS\Email::TYPE_LIST );
|
||||
|
||||
if ( $info )
|
||||
{
|
||||
@@ -364,7 +372,7 @@ class _Notification
|
||||
}
|
||||
else
|
||||
{
|
||||
$classname = 'IPS\\' . $info['follow_app'] . '\\' . ucfirst( $info['follow_area'] );
|
||||
$classname = 'IPS\\' . $info['follow_app'] . '\\' . mb_ucfirst( $info['follow_area'] );
|
||||
$thingsBeingFollowed[ $info['follow_app'] ][ $info['follow_area'] ][ $info['follow_rel_id'] ] = $classname::load( $info['follow_rel_id'] );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user