Infos:
- Used Zammad version: 5.2.x
- Used Zammad installation type: Package
- Operating system: Debian 11
- Browser + version: Chrome 106.0.5249.61
This is more of a question than a bug report.
I am using the Scheduler to escalate stagnant tickets.
I want to edit the default template /opt/zammad/app/views/mailer/ticket_update/en.html.erb to include the body of the article, so that once a ticket is escalated to 2nd level they can just view the ticket body in the mail. I am having issues with this. I am not very familiar with the variables and how they are implemented. Any assistance appreciated.
When I get the mail now, instead of seeing the article body where I want to see it, I see this:
Information:
#{article / no such object}
I believe I should see the article body where I see #{article / no such object} (this is my understanding). My ticket_update/en.html.erb looks like this:
Updated Ticket (#{ticket.title})
<div>Hi #{recipient.firstname},</div>
<br>
<div>Ticket: (#{ticket.title}) has been updated by "<b>#{current_user.longname}</b>".</div>
<br>
<div>
#{t('Group')}: #{ticket.group.name}<br>
#{t('Owner')}: #{ticket.owner.fullname}<br>
#{t('State')}: #{t(ticket.state.name)}<br>
</div>
<br>
<% if @objects[:article] %>
<div>
#{t('Information')}:
<blockquote type="cite">
#{article.body_as_html}
</blockquote>
</div>
<% end %>
<% if @objects[:changes].present? %>
<div>
#{t('Changes:')}:<br>
<% @objects[:changes].each do |key, value| %>
<%= t key %>: <%= h value[0] %> -> <%= h value[1] %><br>
<% end %>
#{t('Information')}:
<blockquote type="cite">
#{article.body_as_html}
</blockquote>
</div>
<% end %>
<br>
<div>
<a href="#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}" target="zammad_app">#{t('View this in Zammad')}</a>
</div>
So I thought I would see the content of article.body_as_html - but in place, I see #{article / no such object}
Its probably something very simple.
The resulting email looks like this:
Hi Mark,
Ticket: (Escalation check 3) has been updated by “-”.
Group: 2nd Level Support
Owner: -
State: new>Changes - edited by Mark:
Group: 1st Level → 2nd Level Support
Information:
#{article / no such object}View this in Zammad
I made the #{article / no such object} bold to highlight it
I want it to look like:
Hi Mark,
Ticket: (Escalation check 3) has been updated by “-”.
Group: 2nd Level Support
Owner: -
State: newChanges - edited by Mark:
Group: 1st Level → 2nd Level Support
Information:
Hi, this is a customer sending an email to your support desk. This is the most recent response from the customer.View this in Zammad
What am I doing wrong? I am just copying what I see in other templates to this one - but I am definitely getting it wrong.
Again, any help, tips or pointers appreciated.