Quick Messages - customisation

narelle_s
Kilo Explorer

Hi,

Not sure if this is the correct pleace to pop this, so point me in the right direction if not. I'm new.

I have set up some Quick Messages, using HTML as the bulk of the content, for use by some incident management groups, and they have asked if it is possible to pre-populate the Subject with something useful, depending on the quick message selected. Perhaps the name of the quick message itself. At the moment, all quick messages default to the task number and the short description.

Also, being able to pre popoulate the To field, depending on which Quick Message is chosen as the template.

Are any changes made to the Quick Message applied to all Quick Messages? Is there a way to alter this?

Hope this makes sense.

Thanks
narelle

20 REPLIES 20

Hi Mark. Do you know if it is possible to set the 'To' recipients on Quick Messages at all? In an ideal world I'd love to set recipients based on the priority of an incident. Any help much appreciated! Thanks, Daniel


ronaldstagg
Tera Contributor

I implemented something similar to your requirement using a background business rule similar to what Mark Stranger proposed earlier.




Our requirements were to:


  1. Create 5 quick messages for standard responses back to change owners
  2. Include a signature line of the submitter
  3. Change the subject line of the email based on the quick message chosen



The solution:


  1. Created the required quick messages (QM) and targeted to appropriate groups Pre-pended "CHG" for our Change module (in the case a user belonged to more than one group and/or worked in more than one module, they would be able to keep them grouped in the drop-down):
    1. 1_quick message.png
  2. Within each QM, added a tag "<AgentSignature>" and a reference to the QM template name (we will use this later in our business rule):
    1. 2_msg text.png
  3. Personalized our "sys_user" table to add a "Signature" field of type "HTML" (in the case users wanted to add formatted text similar to their regular email client signature):
    1. 3_sig field.png
  4. Created a business rule for outgoing mail from within the ServiceNow client:
    1. name: "AgentSignature Tag to Signature"
    2. table: sys_email
    3. active: true
    4. when: before
      1. Insert: true
      2. Update:true
    5. description: Before creating a sys_email record and ONLY when the current type is "send-ready" (which is usually from the SNOW mail client) AND the body contains "<AgentSignature>" (usually placed in a quick message), query for the u_signature of the user who created the sys_email entry (usually the submitter) and replace "<AgentSignature>" with contents of that field. If the user doesn't have a signature, then, build one based on info in their user record.
    6. condition:

      current.type == 'send-ready' && current.body.indexOf("<AgentSignature>") > -1


    7. script:

/*Query for u_signature of user who created the sys_email entry
replace "AgentSignature" with contents of that field. If the
user doesn't have a signature, then, build one based on info in their user record.*/


var rplcdSig = "";


var agent = new GlideRecord("sys_user");


agent.addQuery("user_name",current.sys_created_by);


agent.query();



if (agent.next()) {


    if (!agent.u_signature) {


//No Signature, Building one


rplcdSig = "\n<br/>" + agent.name + " | " + agent.title + "\n<br/>YourCompanyNameHere| " + agent.city + ", " + agent.state + " " + agent.u_country.name + "\n<br/>" + agent.phone + " | " + agent.mobile_phone + "\n<br/>"+ agent.email;


} else {


//Has signature


rplcdSig = "<br/>" + agent.u_signature;


}


}



//replace the tag with the signature


current.body = current.body.replace("<br/><AgentSignature>",rplcdSig);



For the change in subject line, created another business rule:


  1. name: Reset Subject for Quick Message Template
  2. table: sys_email
  3. active: true
  4. when: before
    1. Insert: true
    2. Update:true
  5. description:Before submitting an outbound email from the SNOW email client to the queue, checks the body of the mail for the tag "QMTemplate" and then, based on the name of the quick message used, prepends the desired text to the subject line.
  6. condition:
  7. current.type == 'send-ready' && current.body.indexOf("QMTemplate") > -1
  8. script:
  1. if(current.body.indexOf("QMTemplate: CHG-EOM Exception") > -1){


  2. current.subject ="EOM Exception: "  + current.subject; 


  3. }


  4. if(current.body.indexOf("QMTemplate: CHG-Inadequate Change Description") > -1){


  5. current.subject ="Inadequate Change Description: "  + current.subject; 


  6. }


  7. if(current.body.indexOf("QMTemplate: CHG-Overdue Changes") > -1){


  8. current.subject ="Overdue Change: "  + current.subject; 


  9. }


  10. if(current.body.indexOf("QMTemplate: CHG-Unauthorized change") > -1){


  11. current.subject ="Unauthorized Change: "  + current.subject; 


  12. }



Once an email is sent from within the ServiceNow email client, the output will look something like this:


4_email.png



I hope this helps you


Hi folks



I'm facing a similiar issue:


Why is there the possibility to add an attachment to a quick message   - if it's not possible / a provided funktionality?


At least it's only working for me as admin. But I couldn't find why it's not working for itil users. I looked in the system properties, in the wiki and in the community for the awnser. Do you have any suggestions?



QuickMessage with Attachment.JPG



Thank you


Christina


Hi Christina,



From Wiki


Note


Note: If you add attachments to the Quick Message templates, the attachments are not sent as part of the email distribution.


http://wiki.servicenow.com/index.php?title=Enabling_the_Email_Client#Quick_Messages


-Anurag

Hi Anurag



It's not a template.


  1. I click on the envelope in the header of an incident
  2. I cklick the button   "Attach File"
  3. I search for an image for example and click attach.
  4. I get the message that the attachment was attached
  5. I close the popup dialog
  6. I see that the image is attached to the quick message
  7. I set myself as recipient
  8. I send the message
  9. I get the message with the attachment in outlook

But as I mentioned before: it's only working for me as admin.



BR


Christina