Integrate ticket rating via survey monkey

Hi all,

the basic idea is to add something like this to the zammad signature

rate

which links to the survey URL.

Because you can only use Copy&Paste to add pictures with links to the zammad email signature (as far as I know) I prepared the picture with the link in evernote, copied it to the clipboard and pasted it into the zammad signature.

Works. So far so good as long as the URL is “static” an looks like this:

https://www.surveymonkey.de/r/Z7CXXXS

Now I want to handover the ticket number to survey monkey like this:

https://www.surveymonkey.de/r/Z7CXXXS?c=#{ticket.id}

But, as you can imagine, if I copy a link like this through the clipbaord it will be escaped like this:

https://www.surveymonkey.de/r/Z7CXXXS?c=#%7Bticket.id%7D

Because I am brave I tried the following:

Add a link like this:

https://www.surveymonkey.de/r/Z7CXXXS?c=ticket.id

Go directly to the database and do this:

update signatures set body = replace(body, 'ticket.id','#{ticket.id}');

Sadly another fail. Zammad seems to “cache” the data, ignores the change and after a while the body in the db looks again like before the change.

I don’t know what else I can try and would be very happy if someone has an idea.

Cheers,
Mathias

Hi there!

Just to share with you!

I’m planing to use LimeSurvey a PHP opensource alternative to SurveyMonkey.

I intend to send links on e-mail body to customers 24 hours later after closing tickets. Those links will point to a PHP script that will then fire up the correct survey I need answered.

This script will have to access both Zammad and LimeSurvey API to coordinate things accordingly.

Cheers,
Matias

You probably fiddled with the DB while Rails was running. Try to stop all Zammad processes before changing anything in the DB, that might work better.

Or use the Rails console; this should also work while Zammad is running:

s = Signature.find_by(name: 'test')
s.body.gsub! /ticket\.id/, '#{ticket.id}'
s.save
1 Like

@edneymatias Thank you for pointing that out. But our company uses already survey monkey for other projects.

@martin.von.wittich
Thanks a lot for the tricks. Stopping zammad while updating the DB does not help. Somehow zammad ignores the changes after restart…

The ruby console does the following:

s.body.gsub! /ticket\.id/, '#{ticket.id}'
=> "...<a href=\"https://www.surveymonkey.de/r/Z7CXXXS?\#{ticket.id}\" rel=\"nofollow noreferrer noopener\" target=\"_blank\" title=\"https://www.surveymonkey.de/r/Z7CB5KS?\#{ticket.id}\">..."

Seems cool so far and I was very happy. href and title are looking good. But if I check if it worked and look again to the body it looks like this:

irb(main):078:0> s = Signature.find(1)
=> #<Signature id: 1, name: "default", body: "<br>\#{user.firstname} \#{user.lastname}<div><div><d...", active: true, note: "", updated_by_id: 3, created_by_id: 1, created_at: "2017-05-16 08:15:36", updated_at: "2019-06-28 18:52:13">
irb(main):079:0> s.body
=> "...<a href=\"https://www.surveymonkey.de/r/Z7CB5KS?#%7Bticket.id%7D\" rel=\"nofollow noreferrer noopener\" title=\"https://www.surveymonkey.de/r/Z7CB5KS?\#{ticket.id}\"...

As you can see the title of the link is still valid but some “magic” escapes the href URL again.

Cheers,
Mathias

As far as I’m aware this is currently not supported and working the way you want to do it.

A side note to this: Please note that the ticket number can’t be filled in, if you’re on a ticket creation process, so the signature will be broken for that moment.

The only way that might have worked would be inserting the URL from a clean state (so notepad, something that does not copy or wrap HTML magic around your string) and do it like this:

The result however shows, it’s not working:
image

Guess what, there is an option:
Trigger and Scheduler
image

Again, ensure to copy paste it without HTML content.

Edit: No database and console fiddling needed.
(Also, I’d never hack inside the database directly, but oh well :slight_smile: )

1 Like

@MrGeneration

Thank you for your detailed answer. I also found out yesterday that Trigger and Scheduler behave different from the signature.

It is not exactly what I wanted but an excellent alternative. I will do it like this.

Thank you all again for your help.
Cheers,
Mathias

1 Like

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