triggering a email via catalog item

Srvs
Kilo Guru

Hi,

is it possible to trigger a email via catalog form,

i need to send a email, that contains all the data available in catalog form. how do this.

i created a catalog item, i have several fields in that form, after submiting that need to trigger the email.

14 REPLIES 14

If this is specific to one catalog item alone, You should add the notification in your workflow. See screenshot below



Your workflow should be on requested item table, The first two lines gives you access to fields on requested item. Similarly you can access all other fields in it



Number: ${number}


Item: ${cat_item}



If you want to display catalog variables in your mail, Access them with this syntax   ${variables.variable_name}



State : ${variables.state}


Country: ${variables.country}



notif.jpg





Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


I have a question, many forms may be pointing to same table. How to differentiate, when you want the notification of particular form to be sent instead of all forms pointingto that table?

vinothkumar
Tera Guru

Hi Venkatesh,



I have tried the same in my personal instance. I have wrote the below script to get the RITM variables and updating them in the task description. You can add "Notification activity in the workfflow and you can send the description to the user using this activity.



var gr = new GlideRecord("sc_req_item");


  gr.addQuery("request", current.request.sys_id);


  gr.query();


  while(gr.next()) {


  // Get Owned Variables for Requested Item and sort by Order


  var ownvar = new GlideRecord('sc_item_option_mtom');


  ownvar.addQuery('request_item.number', gr.number);


  ownvar.addQuery('sc_item_option.value','!=','');


  ownvar.orderBy('sc_item_option.order');


  ownvar.query();


  var items = "Description " + "\n";


  while(ownvar.next()) {


  var field = ownvar.sc_item_option.item_option_new;


  var fieldValue = ownvar.sc_item_option.item_option_new.name;


  // Print variable name



  items += field.getDisplayValue() + ": " + gr.variables[fieldValue].getDisplayValue() + "\n";


  }



  task.description = items;


}



Notification:



find_real_file.png



Please let me know if you need any further help on this.


is this by using workflow na??


creating notification is okay,? what is above code you mentioned above that, where can i write that code. please tell me.