#{article.body_as_html} agent only?

  • Used Zammad version: 3.6.x
  • Used Zammad installation source: (source, package, …) repo
  • Operating system: debian 10
  • Browser + version: any

I have triggers that send an email based on ticket updates, e.g. note added, state changed.
I have a schedule that sends customers an email reminding them to response.

In the schedule email I am using the variable #{article.body_as_html} so that the customer does not have to log in to see the latest note on the ticket.

This works fine except that when the triggers send an email based on a ticket update the system leaves a note on the ticket showing that the email has been sent.
When the schedule then runs instead of #{article.body_as_html} equaling the last Agent note it equals the last trigger “successful email sent” note.

I’m hoping there is an easy answer but I can’t find a variable that is #{article.body_as_html} but agent specific or only for public posts (I have set the trigger email notification to be private)

Alternatively is there a way to stop triggers based on ticket changes adding notes to the ticket?

Many Thanks!

Was having the same issue—take a look at: #{article.body_as_html} uses the last article, even private ones

Yes, what you are after would definitely fix my issue.
I’ve seen your code, forgive my ignorance but has it been/is it in line to be implemented as I can’t see it in my ticket.rb?

ticket.rb has been changed by the team (it’s a bit further down), see here:

Ahh, so it is, nice one.
Again ignorant question what would the variable be that I need to use?

Have you seen the pull requests’ description?

If that doesn’t explain it, please rephrase your question.

Yes, sorry. So I have added the variables into a trigger email to a customer as so:
#{ticket.articles_agent.last.body}
#{ticket.articles_agent_public.last.body}
#{ticket.articles_customer.last.body}
#{ticket.articles_system.last.body}

and the email contains the following text:
#{ticket.articles_agent / no such method}
#{ticket.articles_agent_public / no such method}
#{ticket.articles_customer / no such method}
#{ticket.articles_system / no such method}

Do I need to enable something first or have I got this all wrong?

Pretty sure you haven’t changed Zammad’s source code first—see here:

Also, you would have to run zammad run rake assets:precompile and systemctl restart zammad. And please note that with every update you’ll have to change those two files again…

Many Thanks for your help, I got there in the end!
Seems that only /app/models/ticket.rb needed updating with your code on my version so that made things easier.
Let’s hope it gets put in the mainstream code soon as it’s really, really useful.

All the best

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.