Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Vanilla 2.6 is here! It includes security fixes and requires PHP 7.0. We have therefore ALSO released Vanilla 2.5.2 with security patches if you are still on PHP 5.6 to give you additional time to upgrade.
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

[GitHub Bug #1343] Event issue in class.activitymodel.php - BeforeSendNotification

The event BeforeSendNotification is only raised when the user has enabled the email option in preferences.

function: SendNotification

if ($Force) $Preference = $Force; else { $Preferences = $User->Preferences; $Preference = ArrayValue('Email.'.$Activity->ActivityType, $Preferences, Gdn::Config('Preferences.Email.'.$Activity->ActivityType)); }

....

$this->FireEvent('BeforeSendNotification'); try { $Email->Send(); $Emailed = 2; // similar to http 200 OK }

function: SendNotificationQueue

if (is_object($Email)) { $this->EventArguments = $Notification; $this->FireEvent('BeforeSendNotification'); ....

This means any custom addons that rely on this event will not work.

A suggested fix would be to check all non-standard preferences for the $Activity->ActivityType and in the event of a custom activity being enabled call

$this->FireEvent('BeforeSendNotification');

Sign In or Register to comment.