From 36de5d809b519ddd98f2f12497ec40c28ded698a Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 2 May 2012 13:47:35 +0200 Subject: [PATCH] Improved notifications. --- app/models/ticket/observer/notification.rb | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/app/models/ticket/observer/notification.rb b/app/models/ticket/observer/notification.rb index f366d365b..732a7b4b3 100644 --- a/app/models/ticket/observer/notification.rb +++ b/app/models/ticket/observer/notification.rb @@ -29,8 +29,11 @@ class Ticket::Observer::Notification < ActiveRecord::Observer :subject => 'New Ticket (#{ticket.title})', :body => 'Hi #{recipient.firstname}, -a new Ticket (#{ticket.title}) in Group #{ticket.group.name}, owned by #{ticket.owner.firstname} #{ticket.owner.lastname} - +a new Ticket (#{ticket.title}) via #{article.ticket_article_type.name}. + +Group: #{ticket.group.name} +Owner: #{ticket.owner.firstname} #{ticket.owner.lastname} + From: #{article.from} #{article.body} @@ -79,7 +82,7 @@ Your Zammad Team if event[:name] == 'Ticket::Article' && event[:type] == 'create' # only send article notifications after init article is created (handled by ticket create event) - next if ticket.articles.count >= 1 + next if ticket.articles.count.to_i <= 1 puts 'send new ticket::article notify' @@ -91,8 +94,11 @@ Your Zammad Team :subject => 'Follow Up (#{ticket.title})', :body => 'Hi #{recipient.firstname}, -a follow Up (#{ticket.title}) in Group #{ticket.group.name}, owned by #{ticket.owner.firstname} #{ticket.owner.lastname} - +a follow Up (#{ticket.title}) via #{article.ticket_article_type.name}. + +Group: #{ticket.group.name} +Owner: #{ticket.owner.firstname} #{ticket.owner.lastname} + From: #{article.from} #{article.body} @@ -116,8 +122,11 @@ From: #{article.from} :subject => 'Updated (#{ticket.title})', :body => 'Hi #{recipient.firstname}, -Updated (#{ticket.title}) in Group #{ticket.group.name}, owned by #{ticket.owner.firstname} #{ticket.owner.lastname} - +updated (#{ticket.title}) via #{article.ticket_article_type.name}. + +Group: #{ticket.group.name} +Owner: #{ticket.owner.firstname} #{ticket.owner.lastname} + From: #{article.from} #{article.body}