Fixed issue #851 - user "-" in notification in trigger changes.

This commit is contained in:
Martin Edenhofer 2017-03-25 00:00:41 +01:00
parent 090c6b6d98
commit 30a804691b
2 changed files with 10 additions and 3 deletions

View file

@ -715,8 +715,15 @@ perform changes on ticket
group = self.group group = self.group
next if !group next if !group
email_address = group.email_address email_address = group.email_address
next if !email_address if !email_address
next if !email_address.channel_id logger.info "Unable to send trigger based notification to #{recipient_string} because no email address is set for group '#{group.name}'"
next
end
if !email_address.channel_id
logger.info "Unable to send trigger based notification to #{recipient_string} because no channel is set for email address '#{email_address.email}' (id: #{email_address.id})"
next
end
objects = { objects = {
ticket: self, ticket: self,

View file

@ -44,7 +44,7 @@ class Transaction::Trigger
original_user_id = UserInfo.current_user_id original_user_id = UserInfo.current_user_id
Transaction.execute(reset_user_id: true, disable: ['Transaction::Trigger']) do Transaction.execute(reset_user_id: true, disable: ['Transaction::Trigger', 'Transaction::Notification']) do
triggers.each { |trigger| triggers.each { |trigger|
condition = trigger.condition condition = trigger.condition