2017-04-26 11:28:32 +00:00
|
|
|
Trigger.create_or_update(
|
2018-12-19 17:31:51 +00:00
|
|
|
name: 'auto reply (on new tickets)',
|
|
|
|
condition: {
|
|
|
|
'ticket.action' => {
|
2017-04-26 11:28:32 +00:00
|
|
|
'operator' => 'is',
|
2018-12-19 17:31:51 +00:00
|
|
|
'value' => 'create',
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
'ticket.state_id' => {
|
2017-04-26 11:28:32 +00:00
|
|
|
'operator' => 'is not',
|
2018-12-19 17:31:51 +00:00
|
|
|
'value' => Ticket::State.by_category(:closed).first.id,
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
'article.type_id' => {
|
2017-04-26 11:28:32 +00:00
|
|
|
'operator' => 'is',
|
2018-12-19 17:31:51 +00:00
|
|
|
'value' => [
|
2017-04-26 11:28:32 +00:00
|
|
|
Ticket::Article::Type.lookup(name: 'email').id,
|
|
|
|
Ticket::Article::Type.lookup(name: 'phone').id,
|
|
|
|
Ticket::Article::Type.lookup(name: 'web').id,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'article.sender_id' => {
|
|
|
|
'operator' => 'is',
|
2018-12-19 17:31:51 +00:00
|
|
|
'value' => Ticket::Article::Sender.lookup(name: 'Customer').id,
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
perform: {
|
2017-04-26 11:28:32 +00:00
|
|
|
'notification.email' => {
|
2018-12-19 17:31:51 +00:00
|
|
|
'body' => '<div>Your request <b>(#{config.ticket_hook}#{ticket.number})</b> has been received and will be reviewed by our support staff.</div>
|
2017-04-26 11:28:32 +00:00
|
|
|
<br/>
|
|
|
|
<div>To provide additional information, please reply to this email or click on the following link (for initial login, please request a new password):
|
|
|
|
<a href="#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}">#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}</a>
|
|
|
|
</div>
|
|
|
|
<br/>
|
|
|
|
<div>Your #{config.product_name} Team</div>
|
|
|
|
<br/>
|
|
|
|
<div><i><a href="https://zammad.com">Zammad</a>, your customer support system</i></div>',
|
2017-05-15 22:38:59 +00:00
|
|
|
'recipient' => 'article_last_sender',
|
2018-12-19 17:31:51 +00:00
|
|
|
'subject' => 'Thanks for your inquiry (#{ticket.title})', # rubocop:disable Lint/InterpolationCheck
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
active: true,
|
2017-04-26 11:28:32 +00:00
|
|
|
created_by_id: 1,
|
|
|
|
updated_by_id: 1,
|
|
|
|
)
|
|
|
|
Trigger.create_or_update(
|
2018-12-19 17:31:51 +00:00
|
|
|
name: 'auto reply (on follow up of tickets)',
|
|
|
|
condition: {
|
|
|
|
'ticket.action' => {
|
2017-04-26 11:28:32 +00:00
|
|
|
'operator' => 'is',
|
2018-12-19 17:31:51 +00:00
|
|
|
'value' => 'update',
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
|
|
|
'article.sender_id' => {
|
|
|
|
'operator' => 'is',
|
2018-12-19 17:31:51 +00:00
|
|
|
'value' => Ticket::Article::Sender.lookup(name: 'Customer').id,
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
'article.type_id' => {
|
2017-04-26 11:28:32 +00:00
|
|
|
'operator' => 'is',
|
2018-12-19 17:31:51 +00:00
|
|
|
'value' => [
|
2017-04-26 11:28:32 +00:00
|
|
|
Ticket::Article::Type.lookup(name: 'email').id,
|
|
|
|
Ticket::Article::Type.lookup(name: 'phone').id,
|
|
|
|
Ticket::Article::Type.lookup(name: 'web').id,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
perform: {
|
2017-04-26 11:28:32 +00:00
|
|
|
'notification.email' => {
|
2018-12-19 17:31:51 +00:00
|
|
|
'body' => '<div>Your follow up for <b>(#{config.ticket_hook}#{ticket.number})</b> has been received and will be reviewed by our support staff.</div>
|
2017-04-26 11:28:32 +00:00
|
|
|
<br/>
|
|
|
|
<div>To provide additional information, please reply to this email or click on the following link:
|
|
|
|
<a href="#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}">#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}</a>
|
|
|
|
</div>
|
|
|
|
<br/>
|
|
|
|
<div>Your #{config.product_name} Team</div>
|
|
|
|
<br/>
|
|
|
|
<div><i><a href="https://zammad.com">Zammad</a>, your customer support system</i></div>',
|
2017-05-15 22:38:59 +00:00
|
|
|
'recipient' => 'article_last_sender',
|
2018-12-19 17:31:51 +00:00
|
|
|
'subject' => 'Thanks for your follow up (#{ticket.title})', # rubocop:disable Lint/InterpolationCheck
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
active: false,
|
2017-04-26 11:28:32 +00:00
|
|
|
created_by_id: 1,
|
|
|
|
updated_by_id: 1,
|
|
|
|
)
|
|
|
|
|
|
|
|
Trigger.create_or_update(
|
2018-12-19 17:31:51 +00:00
|
|
|
name: 'customer notification (on owner change)',
|
|
|
|
condition: {
|
2017-04-26 11:28:32 +00:00
|
|
|
'ticket.owner_id' => {
|
2018-12-19 17:31:51 +00:00
|
|
|
'operator' => 'has changed',
|
|
|
|
'pre_condition' => 'current_user.id',
|
|
|
|
'value' => '',
|
2017-04-26 11:28:32 +00:00
|
|
|
'value_completion' => '',
|
|
|
|
}
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
perform: {
|
2017-04-26 11:28:32 +00:00
|
|
|
'notification.email' => {
|
2018-12-19 17:31:51 +00:00
|
|
|
'body' => '<p>The owner of ticket (Ticket##{ticket.number}) has changed and is now "#{ticket.owner.firstname} #{ticket.owner.lastname}".<p>
|
2017-04-26 11:28:32 +00:00
|
|
|
<br/>
|
|
|
|
<p>To provide additional information, please reply to this email or click on the following link:
|
|
|
|
<a href="#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}">#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}</a>
|
|
|
|
</p>
|
|
|
|
<br/>
|
|
|
|
<p><i><a href="https://zammad.com">Zammad</a>, your customer support system</i></p>',
|
|
|
|
'recipient' => 'ticket_customer',
|
2018-12-19 17:31:51 +00:00
|
|
|
'subject' => 'Owner has changed (#{ticket.title})', # rubocop:disable Lint/InterpolationCheck
|
2017-04-26 11:28:32 +00:00
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
active: false,
|
2017-04-26 11:28:32 +00:00
|
|
|
created_by_id: 1,
|
|
|
|
updated_by_id: 1,
|
|
|
|
)
|