Index: branches/5.2.x/core/kernel/db/db_event_handler.php =================================================================== diff -u -N -r15601 -r15608 --- branches/5.2.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 15601) +++ branches/5.2.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 15608) @@ -1,6 +1,6 @@ Application->getUnitOption('email-template', 'TableName') . ' WHERE BindToSystemEvent REGEXP "' . $this->Conn->escape($prefix) . '(\\\\.[^:]*:.*|:.*)"'; - $email_event_ids = $this->Conn->GetCol($sql); + $email_template_ids = $this->Conn->GetCol($sql); - if ( !$email_event_ids ) { + if ( !$email_template_ids ) { return; } // e-mail events, connected to that unit prefix are found $sql = 'SELECT SubscriptionId FROM ' . TABLE_PREFIX . 'SystemEventSubscriptions - WHERE ' . $field . ' = ' . $value . ' AND EmailEventId IN (' . implode(',', $email_event_ids) . ')'; + WHERE ' . $field . ' = ' . $value . ' AND EmailTemplateId IN (' . implode(',', $email_template_ids) . ')'; $ids = $this->Conn->GetCol($sql); if ( !$ids ) {