Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The plugin provides "Survey Conditions" – like the a set of table filters relating to a particular master. For any table (task, incident, etc) and exactly one user field in that table, we defined:

  • the conditions in the table under which the survey should be offered
  • the user who should be offered the survey (we used a custom field we call Contact)
    If the conditions match, an event will fire (with the user as the first parameter and the nav_to URL of the survey as the second parameter) per a business rule included with the plugin.

Keep in mind that there is some opportunity for a sort of "defense of depth" or just plain confusion, depending on what side you want to err on (more notifications or less notifications): any email notification triggered by this event could contain overlapping conditions.

Notification

We had an existing resolution notification which we replaced. The new notification fires upon receipt of the plugin's canned event "task.send_survey". We included conditions which match (overlap) with those of the survey conditions, since future state could conceivably include this event being fired for other tasks.

This notification includes a mail_script hack that modifies the second parameter in-flight in order to break the survey out of the standard frameset; the resulting URL is presented in a prominent CSS "button":

Code Block

<mail_script>
    // bw - since this survey is meant to be frameless, strip the nav_to part of the url.
    var url = event.parm2.replace("nav_to.do?uri=", "");
    url = url.replace(/%20/g, '+');
    url = url.replace(/%26/g, '&');
    template.print('<table><tr><td align="center" width="300" bgcolor="#0F4D92" style="background: #0F4D92; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; color: #fff; font-weight: bold; text-decoration: none; font-family: Helvetica, Arial, sans-serif; display: block;"><a href="' + url + '" style="color: #fff; text-decoration: none;">Click here to take the survey</a></td></tr></table>');
</mail_script>