SRC Notification issue

Hi Guys!

I require your advice how can I send out the notification for this customer which. Please find the attached document with the steps, I have followed.

I tired to use 

jscall( "htmlemailtemplates.getMailBody", "HTML_SM ADD", $L.file, $L.file.save,email in $L.file) it also didn't work for me.

Parents
  • I'm gussing that the agency fields are the identifier for the agency and not the email adddress. The notification engine does not have a default configuration to retrieve the related email address from the dept table. Also, if they are intended to hold the actual email address values, are you populating the fields in the background on record add/save? If you check the fields are they populated in the newly opened ticket?

    You could retrieve the email address based on the department value saved in the record when executing the notification. The script below provides a starting point (you would define a second function for the secondary agency). Based on the primary agency value in the record, it queries the dept table for a matching dept.name (change this field as needed). If a matching dept record is found, it returns::

    1) the dept email address as "$L.primaryAgencyEmail" which can be used as the notification recipient and

    2) returns a value of true or false (needtosend) which is used as the condition result so that if no matching dept record is found, the condition is set to false and SM does not attempt to send a notification.

    /****************************************************************
    *  Function to get the primary agency email address.   
    * Called by Notification Defintion "IM ???? ????" *****************************************************************/

    function getPrimaryAgencyEmail() {
    var needToSend = false var recDept = new SCFile("dept"); // Select the Department Record for the primary agency specified in the record if ( recDept.doSelect("dept.name=\"" vars.$L_file.primary_agency "\"") == RC_SUCCESS ) { vars.$L_primaryAgencyEmail = recDept.email;
    needToSend = true; } return needToSend; }

    In the notification defintion, call the function above in the condition. (Remember that the function will return true or false depending on whether a dept record is found), and then use the returned email address as the recipient value. 

     

    The HTML notification uses the recipient specified in the notification defintion. There is no need to include it as a parameter in the jscall for the notification: You actually don't even need $L.file.save if the notification is not referencing the saved record.

    jscall( "htmlemailtemplates.getMailBody", "HTML_SM ADD", $L.file, $L.file.save) 
    jscall( "htmlemailtemplates.getMailBody", "HTML_SM ADD", $L.file)

     

Reply
  • I'm gussing that the agency fields are the identifier for the agency and not the email adddress. The notification engine does not have a default configuration to retrieve the related email address from the dept table. Also, if they are intended to hold the actual email address values, are you populating the fields in the background on record add/save? If you check the fields are they populated in the newly opened ticket?

    You could retrieve the email address based on the department value saved in the record when executing the notification. The script below provides a starting point (you would define a second function for the secondary agency). Based on the primary agency value in the record, it queries the dept table for a matching dept.name (change this field as needed). If a matching dept record is found, it returns::

    1) the dept email address as "$L.primaryAgencyEmail" which can be used as the notification recipient and

    2) returns a value of true or false (needtosend) which is used as the condition result so that if no matching dept record is found, the condition is set to false and SM does not attempt to send a notification.

    /****************************************************************
    *  Function to get the primary agency email address.   
    * Called by Notification Defintion "IM ???? ????" *****************************************************************/

    function getPrimaryAgencyEmail() {
    var needToSend = false var recDept = new SCFile("dept"); // Select the Department Record for the primary agency specified in the record if ( recDept.doSelect("dept.name=\"" vars.$L_file.primary_agency "\"") == RC_SUCCESS ) { vars.$L_primaryAgencyEmail = recDept.email;
    needToSend = true; } return needToSend; }

    In the notification defintion, call the function above in the condition. (Remember that the function will return true or false depending on whether a dept record is found), and then use the returned email address as the recipient value. 

     

    The HTML notification uses the recipient specified in the notification defintion. There is no need to include it as a parameter in the jscall for the notification: You actually don't even need $L.file.save if the notification is not referencing the saved record.

    jscall( "htmlemailtemplates.getMailBody", "HTML_SM ADD", $L.file, $L.file.save) 
    jscall( "htmlemailtemplates.getMailBody", "HTML_SM ADD", $L.file)

     

Children
No Data