Attachments into an HTML template

We need to attach the attachments from the interaction into HTML notification for the operator. But I can't find this function or method. Maybe I'm looking in the wrong place, or it's impossible.

Could you help me, please?

  • Hi Artem,

    I'm afraid the standard HTML notification rule doesn't support attachments. Maybe I'm not up to date because I had the problem 2 years ago!

    I had to write my own SL for this. This is a snippet I found on my disk (not testet!!!):

    var fMail = new SCFile('mail'); fMail['mailno'] = lib.MailUtil.newMailno(); fMail[''] = _aRecipientMails.join(','); fMail['user.from'] = system.functions.operator(); fMail[''] = system.functions.tod(); fMail['status'] = 'sent'; fMail['subject'] = lib.htmlemailtemplates.getMailHeader(htmltemplatename, record, record, _aRecipientMails[0], htmltemplatelanguage); fMail['application'] = 'email'; fMail['text'].push(lib.htmlemailtemplates.getMailBody(htmltemplatename, record, record, _aRecipientMails[0], htmltemplatelanguage, true);); fMail['user.array'] = _aRecipientMails; fMail['ccuser.array'] = null; fMail['bccuser.array'] = null; var attachment = new Attachment(); = sAttachmentFileName; attachment.type = sAttachmentDataType || 'text/plain'; attachment.value = data; var attachmentID = fMail.insertAttachment(attachment); var parameters = { 'record' : fMail }; lib.c.$.callrad('', parameters);


    Hope this helps as a starting point...


  • Thanks for the tip, but where did you write this?

    Changes to the Master or Rule?

  • Hi Artem,

    we created a RuleSet in the Incident Workflow with a Javascript Validation Rule. In the rule we called the ScriptLibrary function with the current record and the htmltemplate name as parameters.

    That's all!



  • Hi, what is _aRecipientMails?
    I create a set of rules according to your example, and I get an error

    ReferenceError: _aRecipientMails is not defined Could not process script.

    I tried to execute it simply in the script, but also saw this error.
    help me, please

  • Hi,


    Did you ever get this implemented? What version of SM9 are you using for this?