2015-01-03 22:53:07 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
|
2014-08-26 00:18:31 +00:00
|
|
|
class Observer::Ticket::Notification::BackgroundJob
|
2016-02-03 07:58:51 +00:00
|
|
|
def initialize(params, via_web = false)
|
2015-01-09 19:44:04 +00:00
|
|
|
@p = params
|
2016-02-03 07:58:51 +00:00
|
|
|
@via_web = via_web
|
2014-08-25 23:58:04 +00:00
|
|
|
end
|
2015-05-07 10:27:12 +00:00
|
|
|
|
2014-08-25 23:58:04 +00:00
|
|
|
def perform
|
2016-01-15 17:22:57 +00:00
|
|
|
ticket = Ticket.find(@p[:ticket_id])
|
2015-01-09 19:44:04 +00:00
|
|
|
if @p[:article_id]
|
|
|
|
article = Ticket::Article.find(@p[:article_id])
|
2015-01-03 22:53:07 +00:00
|
|
|
end
|
2014-08-25 23:58:04 +00:00
|
|
|
|
|
|
|
# find recipients
|
2016-02-07 13:00:29 +00:00
|
|
|
recipients_and_channels = []
|
2014-08-25 23:58:04 +00:00
|
|
|
|
2015-01-03 22:53:07 +00:00
|
|
|
=begin
|
2014-08-25 23:58:04 +00:00
|
|
|
# group of agents to work on
|
|
|
|
if data[:recipient] == 'group'
|
|
|
|
recipients = ticket.agent_of_group()
|
|
|
|
|
2015-01-02 15:50:31 +00:00
|
|
|
# owner
|
2014-08-25 23:58:04 +00:00
|
|
|
elsif data[:recipient] == 'owner'
|
|
|
|
if ticket.owner_id != 1
|
|
|
|
recipients.push ticket.owner
|
|
|
|
end
|
|
|
|
|
2015-01-02 15:50:31 +00:00
|
|
|
# customer
|
2014-08-25 23:58:04 +00:00
|
|
|
elsif data[:recipient] == 'customer'
|
|
|
|
if ticket.customer_id != 1
|
|
|
|
# temporarily disabled
|
|
|
|
# recipients.push ticket.customer
|
|
|
|
end
|
|
|
|
|
2015-01-02 15:50:31 +00:00
|
|
|
# owner or group of agents to work on
|
2014-08-25 23:58:04 +00:00
|
|
|
elsif data[:recipient] == 'to_work_on'
|
|
|
|
if ticket.owner_id != 1
|
|
|
|
recipients.push ticket.owner
|
|
|
|
else
|
|
|
|
recipients = ticket.agent_of_group()
|
|
|
|
end
|
|
|
|
end
|
2015-01-03 22:53:07 +00:00
|
|
|
=end
|
|
|
|
|
2016-02-07 13:00:29 +00:00
|
|
|
# loop through all users
|
|
|
|
possible_recipients = ticket.agent_of_group
|
|
|
|
if ticket.owner_id == 1
|
|
|
|
possible_recipients.push ticket.owner
|
2015-01-03 22:53:07 +00:00
|
|
|
end
|
2016-02-07 13:00:29 +00:00
|
|
|
already_checked_recipient_ids = {}
|
|
|
|
possible_recipients.each {|user|
|
|
|
|
next if already_checked_recipient_ids[user.id]
|
|
|
|
already_checked_recipient_ids[user.id] = true
|
|
|
|
next if !user.preferences
|
|
|
|
next if !user.preferences['notification_config']
|
|
|
|
matrix = user.preferences['notification_config']['matrix']
|
|
|
|
if ticket.owner_id != user.id
|
|
|
|
if user.preferences['notification_config']['group_ids'] ||
|
|
|
|
(user.preferences['notification_config']['group_ids'].class == Array && (!user.preferences['notification_config']['group_ids'].empty? || user.preferences['notification_config']['group_ids'][0] != '-'))
|
|
|
|
hit = false
|
|
|
|
user.preferences['notification_config']['group_ids'].each {|notify_group_id|
|
|
|
|
user.group_ids.each {|local_group_id|
|
|
|
|
if local_group_id.to_s == notify_group_id.to_s
|
|
|
|
hit = true
|
|
|
|
end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
next if !hit
|
|
|
|
end
|
|
|
|
end
|
|
|
|
next if !matrix
|
|
|
|
next if !matrix[@p[:type]]
|
|
|
|
data = matrix[@p[:type]]
|
|
|
|
next if !data
|
|
|
|
next if !data['criteria']
|
|
|
|
channels = data['channel']
|
2016-02-08 22:06:21 +00:00
|
|
|
next if !channels
|
2016-02-07 13:00:29 +00:00
|
|
|
if data['criteria']['owned_by_me'] && ticket.owner_id == user.id
|
|
|
|
data = {
|
|
|
|
user: user,
|
|
|
|
channels: channels
|
|
|
|
}
|
|
|
|
recipients_and_channels.push data
|
|
|
|
next
|
|
|
|
end
|
|
|
|
if data['criteria']['owned_by_nobody'] && ticket.owner_id == 1
|
|
|
|
data = {
|
|
|
|
user: user,
|
|
|
|
channels: channels
|
|
|
|
}
|
|
|
|
recipients_and_channels.push data
|
|
|
|
next
|
|
|
|
end
|
|
|
|
next unless data['criteria']['no']
|
|
|
|
data = {
|
|
|
|
user: user,
|
|
|
|
channels: channels
|
|
|
|
}
|
|
|
|
recipients_and_channels.push data
|
|
|
|
next
|
|
|
|
}
|
2014-08-25 23:58:04 +00:00
|
|
|
|
|
|
|
# send notifications
|
2015-01-03 22:53:07 +00:00
|
|
|
recipient_list = ''
|
2016-02-07 13:00:29 +00:00
|
|
|
recipients_and_channels.each do |item|
|
|
|
|
user = item[:user]
|
|
|
|
channels = item[:channels]
|
2015-01-02 15:50:31 +00:00
|
|
|
|
2016-02-03 07:58:51 +00:00
|
|
|
# ignore user who changed it by him self via web
|
|
|
|
if @via_web
|
|
|
|
next if article && article.updated_by_id == user.id
|
|
|
|
next if !article && ticket.updated_by_id == user.id
|
|
|
|
end
|
2015-01-09 19:44:04 +00:00
|
|
|
|
|
|
|
# ignore inactive users
|
2015-01-02 15:53:59 +00:00
|
|
|
next if !user.active
|
2015-01-02 15:50:31 +00:00
|
|
|
|
2016-02-07 13:00:29 +00:00
|
|
|
# ignore if no changes has been done
|
|
|
|
changes = human_changes(user, ticket)
|
|
|
|
next if @p[:type] == 'update' && !article && ( !changes || changes.empty? )
|
2014-08-25 23:58:04 +00:00
|
|
|
|
2016-02-07 13:00:29 +00:00
|
|
|
# create online notification
|
|
|
|
used_channels = []
|
|
|
|
if channels['online']
|
|
|
|
used_channels.push 'online'
|
|
|
|
seen = ticket.online_notification_seen_state(user.id)
|
|
|
|
OnlineNotification.add(
|
|
|
|
type: @p[:type],
|
|
|
|
object: 'Ticket',
|
|
|
|
o_id: ticket.id,
|
|
|
|
seen: seen,
|
|
|
|
created_by_id: ticket.updated_by_id || 1,
|
|
|
|
user_id: user.id,
|
|
|
|
)
|
|
|
|
Rails.logger.info "send ticket online notifiaction to agent (#{@p[:type]}/#{ticket.id}/#{user.email})"
|
2014-08-25 23:58:04 +00:00
|
|
|
end
|
|
|
|
|
2016-02-07 13:00:29 +00:00
|
|
|
# ignore email channel notificaiton and empty emails
|
2016-02-08 11:01:32 +00:00
|
|
|
if !channels['email'] || !user.email || user.email == ''
|
2016-02-07 15:53:21 +00:00
|
|
|
add_recipient_list(ticket, user, used_channels)
|
2015-01-09 19:44:04 +00:00
|
|
|
next
|
|
|
|
end
|
2015-01-04 12:52:14 +00:00
|
|
|
|
2016-02-07 13:00:29 +00:00
|
|
|
used_channels.push 'email'
|
2016-02-07 15:53:21 +00:00
|
|
|
add_recipient_list(ticket, user, used_channels)
|
2016-02-07 13:00:29 +00:00
|
|
|
|
2015-01-03 22:53:07 +00:00
|
|
|
# get user based notification template
|
|
|
|
# if create, send create message / block update messages
|
2015-01-09 19:44:04 +00:00
|
|
|
if @p[:type] == 'create'
|
2015-05-07 12:10:38 +00:00
|
|
|
template = template_create(user, ticket, article, changes)
|
2015-01-09 19:44:04 +00:00
|
|
|
elsif @p[:type] == 'update'
|
2015-05-07 12:10:38 +00:00
|
|
|
template = template_update(user, ticket, article, changes)
|
2015-01-03 22:53:07 +00:00
|
|
|
else
|
2015-05-07 11:27:07 +00:00
|
|
|
fail "unknown type for notification #{@p[:type]}"
|
2015-01-03 22:53:07 +00:00
|
|
|
end
|
|
|
|
|
2014-08-25 23:58:04 +00:00
|
|
|
# prepare subject & body
|
|
|
|
notification = {}
|
|
|
|
[:subject, :body].each { |key|
|
|
|
|
notification[key.to_sym] = NotificationFactory.build(
|
2015-04-27 13:42:53 +00:00
|
|
|
locale: user.preferences[:locale],
|
|
|
|
string: template[key],
|
|
|
|
objects: {
|
|
|
|
ticket: ticket,
|
|
|
|
article: article,
|
|
|
|
recipient: user,
|
2014-08-25 23:58:04 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
# rebuild subject
|
2016-02-07 13:00:29 +00:00
|
|
|
notification[:subject] = ticket.subject_build(notification[:subject])
|
2014-08-25 23:58:04 +00:00
|
|
|
|
2016-02-07 13:00:29 +00:00
|
|
|
Rails.logger.info "send ticket email notifiaction to agent (#{@p[:type]}/#{ticket.id}/#{user.email})"
|
2015-01-03 22:53:07 +00:00
|
|
|
|
2014-08-25 23:58:04 +00:00
|
|
|
NotificationFactory.send(
|
2015-04-27 13:42:53 +00:00
|
|
|
recipient: user,
|
|
|
|
subject: notification[:subject],
|
|
|
|
body: notification[:body],
|
|
|
|
content_type: 'text/html',
|
2014-08-25 23:58:04 +00:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2016-02-07 15:53:21 +00:00
|
|
|
end
|
2015-04-30 15:25:04 +00:00
|
|
|
|
2016-02-07 15:53:21 +00:00
|
|
|
def add_recipient_list(ticket, user, channels)
|
|
|
|
return if channels.empty?
|
2016-02-07 16:17:27 +00:00
|
|
|
identifier = user.email
|
2016-02-08 05:58:28 +00:00
|
|
|
if !identifier || identifier == ''
|
2016-02-07 16:17:27 +00:00
|
|
|
identifier = user.login
|
|
|
|
end
|
|
|
|
recipient_list = "#{identifier}(#{channels.join(',')})"
|
2015-04-30 15:25:04 +00:00
|
|
|
History.add(
|
|
|
|
o_id: ticket.id,
|
|
|
|
history_type: 'notification',
|
|
|
|
history_object: 'Ticket',
|
|
|
|
value_to: recipient_list,
|
2015-05-01 12:36:36 +00:00
|
|
|
created_by_id: ticket.updated_by_id || 1
|
2015-04-30 15:25:04 +00:00
|
|
|
)
|
2014-08-25 23:58:04 +00:00
|
|
|
end
|
2015-01-03 22:53:07 +00:00
|
|
|
|
2015-01-04 12:52:14 +00:00
|
|
|
def human_changes(user, record)
|
|
|
|
|
2015-01-09 19:44:04 +00:00
|
|
|
return {} if !@p[:changes]
|
2015-01-04 12:52:14 +00:00
|
|
|
|
|
|
|
# only show allowed attributes
|
|
|
|
attribute_list = ObjectManager::Attribute.by_object_as_hash('Ticket', user)
|
2015-01-04 15:39:57 +00:00
|
|
|
#puts "AL #{attribute_list.inspect}"
|
2015-01-04 12:52:14 +00:00
|
|
|
user_related_changes = {}
|
2015-01-09 19:44:04 +00:00
|
|
|
@p[:changes].each {|key, value|
|
2015-01-04 15:39:57 +00:00
|
|
|
|
|
|
|
# if no config exists, use all attributes
|
|
|
|
if !attribute_list || attribute_list.empty?
|
|
|
|
user_related_changes[key] = value
|
|
|
|
|
|
|
|
# if config exists, just use existing attributes for user
|
|
|
|
elsif attribute_list[key.to_s]
|
2015-01-04 12:52:14 +00:00
|
|
|
user_related_changes[key] = value
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
|
|
|
changes = {}
|
|
|
|
user_related_changes.each {|key, value|
|
|
|
|
|
|
|
|
# get attribute name
|
|
|
|
attribute_name = key.to_s
|
|
|
|
object_manager_attribute = attribute_list[attribute_name]
|
2015-04-27 14:53:29 +00:00
|
|
|
if attribute_name[-3, 3] == '_id'
|
2015-04-27 14:41:03 +00:00
|
|
|
attribute_name = attribute_name[ 0, attribute_name.length - 3 ].to_s
|
2015-01-04 12:52:14 +00:00
|
|
|
end
|
2015-02-10 22:48:14 +00:00
|
|
|
|
|
|
|
# add item to changes hash
|
|
|
|
if key.to_s == attribute_name
|
|
|
|
changes[attribute_name] = value
|
2015-01-04 12:52:14 +00:00
|
|
|
end
|
|
|
|
|
2015-02-10 22:48:14 +00:00
|
|
|
# if changed item is an _id field/reference, do an lookup for the realy values
|
|
|
|
value_id = []
|
2015-01-04 12:52:14 +00:00
|
|
|
value_str = [ value[0], value[1] ]
|
2015-04-27 14:53:29 +00:00
|
|
|
if key.to_s[-3, 3] == '_id'
|
2015-01-04 12:52:14 +00:00
|
|
|
value_id[0] = value[0]
|
|
|
|
value_id[1] = value[1]
|
|
|
|
|
|
|
|
if record.respond_to?( attribute_name ) && record.send(attribute_name)
|
|
|
|
relation_class = record.send(attribute_name).class
|
|
|
|
if relation_class && value_id[0]
|
2015-04-27 13:42:53 +00:00
|
|
|
relation_model = relation_class.lookup( id: value_id[0] )
|
2015-01-04 12:52:14 +00:00
|
|
|
if relation_model
|
|
|
|
if relation_model['name']
|
|
|
|
value_str[0] = relation_model['name']
|
|
|
|
elsif relation_model.respond_to?('fullname')
|
|
|
|
value_str[0] = relation_model.send('fullname')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if relation_class && value_id[1]
|
2015-04-27 13:42:53 +00:00
|
|
|
relation_model = relation_class.lookup( id: value_id[1] )
|
2015-01-04 12:52:14 +00:00
|
|
|
if relation_model
|
|
|
|
if relation_model['name']
|
|
|
|
value_str[1] = relation_model['name']
|
|
|
|
elsif relation_model.respond_to?('fullname')
|
|
|
|
value_str[1] = relation_model.send('fullname')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-02-10 22:48:14 +00:00
|
|
|
|
|
|
|
# check if we have an dedcated display name for it
|
2015-01-04 12:52:14 +00:00
|
|
|
display = attribute_name
|
|
|
|
if object_manager_attribute && object_manager_attribute[:display]
|
2015-02-10 22:48:14 +00:00
|
|
|
|
|
|
|
# delete old key
|
|
|
|
changes.delete( display )
|
|
|
|
|
|
|
|
# set new key
|
|
|
|
display = object_manager_attribute[:display].to_s
|
2015-01-04 12:52:14 +00:00
|
|
|
end
|
2016-01-15 17:22:57 +00:00
|
|
|
changes[display] = if object_manager_attribute && object_manager_attribute[:translate]
|
|
|
|
["i18n(#{value_str[0]})", "i18n(#{value_str[1]})"]
|
|
|
|
else
|
|
|
|
[value_str[0].to_s, value_str[1].to_s]
|
|
|
|
end
|
2015-01-04 12:52:14 +00:00
|
|
|
}
|
|
|
|
changes
|
|
|
|
end
|
|
|
|
|
2015-05-07 08:01:35 +00:00
|
|
|
def template_create(user, ticket, article, _ticket_changes)
|
2015-01-03 22:53:07 +00:00
|
|
|
article_content = ''
|
|
|
|
if article
|
2015-10-27 07:34:55 +00:00
|
|
|
article_content = 'i18n(Information):
|
2015-01-09 01:38:59 +00:00
|
|
|
<blockquote type="cite">
|
2015-01-04 21:28:58 +00:00
|
|
|
#{article.body.text2html}
|
|
|
|
</blockquote>
|
2015-01-09 13:17:34 +00:00
|
|
|
<br>
|
2015-01-04 21:28:58 +00:00
|
|
|
<br>'
|
2015-01-03 22:53:07 +00:00
|
|
|
end
|
|
|
|
|
2015-01-04 12:52:14 +00:00
|
|
|
if user.preferences[:locale] =~ /^de/i
|
2015-01-03 22:53:07 +00:00
|
|
|
subject = 'Neues Ticket (#{ticket.title})'
|
2015-01-04 21:28:58 +00:00
|
|
|
body = '<div>Hallo #{recipient.firstname.text2html},</div>
|
|
|
|
<br>
|
|
|
|
<div>
|
|
|
|
es wurde ein neues Ticket (#{ticket.title.text2html}) von "<b>#{ticket.updated_by.fullname.text2html}</b>" erstellt.
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<div>
|
|
|
|
i18n(Group): #{ticket.group.name.text2html}<br>
|
|
|
|
i18n(Owner): #{ticket.owner.fullname.text2html}<br>
|
|
|
|
i18n(State): i18n(#{ticket.state.name.text2html})<br>
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<div>
|
2015-01-03 22:53:07 +00:00
|
|
|
' + article_content + '
|
2015-01-04 21:28:58 +00:00
|
|
|
</div>
|
2015-01-03 22:53:07 +00:00
|
|
|
'
|
|
|
|
else
|
|
|
|
|
|
|
|
subject = 'New Ticket (#{ticket.title})'
|
2015-01-04 21:28:58 +00:00
|
|
|
body = '<div>Hi #{recipient.firstname.text2html},</div>
|
|
|
|
<br>
|
|
|
|
<div>
|
|
|
|
a new Ticket (#{ticket.title.text2html}) has been created by "<b>#{ticket.updated_by.fullname.text2html}</b>".
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<div>
|
|
|
|
Group: #{ticket.group.name.text2html}<br>
|
|
|
|
Owner: #{ticket.owner.fullname.text2html}<br>
|
|
|
|
State: i18n(#{ticket.state.name.text2html})<br>
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<div>
|
2015-01-03 22:53:07 +00:00
|
|
|
' + article_content + '
|
2015-01-04 21:28:58 +00:00
|
|
|
</div>
|
2015-01-03 22:53:07 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2015-01-04 21:28:58 +00:00
|
|
|
body = template_header(user) + body
|
2015-01-04 12:52:14 +00:00
|
|
|
body += template_footer(user, ticket, article)
|
2015-01-03 22:53:07 +00:00
|
|
|
|
|
|
|
template = {
|
2015-04-27 13:42:53 +00:00
|
|
|
subject: subject,
|
|
|
|
body: body,
|
2015-01-03 22:53:07 +00:00
|
|
|
}
|
|
|
|
template
|
|
|
|
end
|
|
|
|
|
2015-01-04 12:52:14 +00:00
|
|
|
def template_update(user, ticket, article, ticket_changes)
|
2015-01-03 22:53:07 +00:00
|
|
|
changes = ''
|
2015-04-27 14:53:29 +00:00
|
|
|
ticket_changes.each {|key, value|
|
2015-01-04 21:28:58 +00:00
|
|
|
changes += "i18n(#{key.to_s.text2html}): #{value[0].to_s.text2html} -> #{value[1].to_s.text2html}<br>\n"
|
2015-01-03 22:53:07 +00:00
|
|
|
}
|
|
|
|
article_content = ''
|
|
|
|
if article
|
2015-10-27 07:34:55 +00:00
|
|
|
article_content = 'i18n(Information):
|
2015-01-04 21:28:58 +00:00
|
|
|
<blockquote type="cite">
|
|
|
|
#{article.body.text2html}
|
|
|
|
</blockquote>
|
2015-01-09 13:17:34 +00:00
|
|
|
<br>
|
2015-01-04 21:28:58 +00:00
|
|
|
<br>'
|
2015-01-03 22:53:07 +00:00
|
|
|
end
|
2015-01-04 12:52:14 +00:00
|
|
|
if user.preferences[:locale] =~ /^de/i
|
2015-01-22 07:17:06 +00:00
|
|
|
subject = 'Ticket aktualisiert (#{ticket.title})'
|
2015-01-04 21:28:58 +00:00
|
|
|
body = '<div>Hallo #{recipient.firstname.text2html},</div>
|
|
|
|
<br>
|
|
|
|
<div>
|
|
|
|
Ticket (#{ticket.title.text2html}) wurde von "<b>#{ticket.updated_by.fullname.text2html}</b>" aktualisiert.
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<div>
|
2015-10-27 07:34:55 +00:00
|
|
|
i18n(Changes):<br>
|
2015-01-03 22:53:07 +00:00
|
|
|
' + changes + '
|
2015-01-04 21:28:58 +00:00
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<div>
|
2015-01-03 22:53:07 +00:00
|
|
|
' + article_content + '
|
2015-01-04 21:28:58 +00:00
|
|
|
</div>
|
2015-01-03 22:53:07 +00:00
|
|
|
'
|
|
|
|
else
|
2015-01-22 07:17:06 +00:00
|
|
|
subject = 'Updated Ticket (#{ticket.title})'
|
2015-01-04 21:28:58 +00:00
|
|
|
body = '<div>Hi #{recipient.firstname.text2html},</div>
|
|
|
|
<br>
|
|
|
|
<div>
|
|
|
|
Ticket (#{ticket.title.text2html}) has been updated by "<b>#{ticket.updated_by.fullname.text2html}</b>".
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<div>
|
2015-10-27 07:34:55 +00:00
|
|
|
i18n(Changes):<br>
|
2015-01-03 22:53:07 +00:00
|
|
|
' + changes + '
|
2015-01-04 21:28:58 +00:00
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<div>
|
2015-01-03 22:53:07 +00:00
|
|
|
' + article_content + '
|
2015-01-04 21:28:58 +00:00
|
|
|
</div>
|
2015-01-03 22:53:07 +00:00
|
|
|
'
|
|
|
|
end
|
|
|
|
|
2015-01-04 21:28:58 +00:00
|
|
|
body = template_header(user) + body
|
2015-04-27 14:53:29 +00:00
|
|
|
body += template_footer(user, ticket, article)
|
2015-01-03 22:53:07 +00:00
|
|
|
|
|
|
|
template = {
|
2015-04-27 13:42:53 +00:00
|
|
|
subject: subject,
|
|
|
|
body: body,
|
2015-01-03 22:53:07 +00:00
|
|
|
}
|
|
|
|
template
|
|
|
|
end
|
|
|
|
|
2015-05-07 08:01:35 +00:00
|
|
|
def template_header(_user)
|
2015-01-03 22:53:07 +00:00
|
|
|
'
|
|
|
|
<style type="text/css">
|
2016-02-08 22:06:21 +00:00
|
|
|
blockquote {
|
|
|
|
border-left: 2px solid blue;
|
|
|
|
padding-left: 1em;
|
|
|
|
}
|
2015-01-03 22:53:07 +00:00
|
|
|
.header {
|
|
|
|
color: #aaaaaa;
|
|
|
|
border-bottom-style:solid;
|
|
|
|
border-bottom-width:1px;
|
|
|
|
border-bottom-color:#aaaaaa;
|
|
|
|
width: 100%;
|
|
|
|
max-width: 600px;
|
|
|
|
padding-bottom: 6px;
|
|
|
|
margin-bottom: 16px;
|
|
|
|
padding-top: 6px;
|
|
|
|
font-size: 16px;
|
|
|
|
}
|
|
|
|
.footer {
|
|
|
|
color: #aaaaaa;
|
|
|
|
border-top-style:solid;
|
|
|
|
border-top-width:1px;
|
|
|
|
border-top-color:#aaaaaa;
|
|
|
|
width: 100%;
|
|
|
|
max-width: 600px;
|
|
|
|
padding-top: 6px;
|
|
|
|
margin-top: 16px;
|
|
|
|
padding-botton: 6px;
|
|
|
|
}
|
|
|
|
.footer a {
|
|
|
|
color: #aaaaaa;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<div class="header">
|
|
|
|
#{config.product_name} i18n(Notification)
|
|
|
|
</div>
|
|
|
|
'
|
|
|
|
end
|
|
|
|
|
2015-05-07 08:01:35 +00:00
|
|
|
def template_footer(_user, _ticket, _article)
|
2015-01-03 22:53:07 +00:00
|
|
|
'
|
2015-01-04 21:28:58 +00:00
|
|
|
<p>
|
2015-12-10 10:39:12 +00:00
|
|
|
<a href="#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}" target="zammad_app">i18n(View this in Zammad)</a>
|
2015-01-04 21:28:58 +00:00
|
|
|
</p>
|
2015-01-03 22:53:07 +00:00
|
|
|
<div class="footer">
|
|
|
|
<a href="#{config.http_type}://#{config.fqdn}/#profile/notifications">i18n(Manage your notifications settings)</a>
|
|
|
|
</div>
|
|
|
|
'
|
|
|
|
end
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|