ITMS Administrator Group

 View Only

How to send attachment in the Automation Policy e-mail? 

Mar 23, 2015 05:12 PM

In IT Management Suite 7.6, you can add an attachment to the Automation Policy e-mail. Note that no UI changes are introduced and it is just a way to define attachment in the existing UI.

You can use this option for Send automated report e-mail task, Send automation policy e-mail task, etc.

To add an attachment to an e-mail, you must add some "markup" tokens to define the attachments and the body in the email body definition as follows:

<!-- SMP:[type];[name;mime] -->
[type] can be one of the following:
  • A/ATT/ATTACH - to define attachment text. Everything until the next "markup" (or message end, if none) is treated as the attachment content.
  • F/FILE - to define a file name to be included (must be full pathname on Notification Server computer)
  • B/BODY/(none) - to define the body of the e-mail

[name] - the name of the attachment or file
[mime] - one of the encoding types "text/plain", "text/html" etc. If not specified, default is used or resolved by file type automatically.

 

EXAMPLE 1: to attach a report

<!-- SMP:A;report.htm -->
<html><body>%!Results!%</body></html>

<!-- SMP:B -->
<html><body>Please check attachment</html></body>

NB! The marker start should only have 1 space between "<!--" and "SMP:" to match.

 

EXAMPLE 2: to attach a particular file by path, used 'F'

<!-- SMP:F;C:\report1.htm -->

or 'A' with '@' before file name

<!-- SMP:A;@C:\report1.htm -->

 

EXAMPLE 3: to attach a ZIP document

<!-- SMP:ZA;report.html.zip -->

This content of the section will be zipped.

<!-- SMP:ZF;symantec-logs.zip;;c:\ProgramData\Symantec\SMP\Logs*.log -->

All .log files from the default folder will be zipped and added to the attachment as a single file.

Statistics
0 Favorited
3 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Aug 15, 2016 11:50 AM

Article about adding tokens to the subject line of an Automation Policy:

https://www.symantec.com/connect/articles/how-add-token-subject-line-automation-policy-e-mail

Mar 31, 2016 01:34 PM

Also there are some details that can be found under: 

  TECH234325 "How to send CSV results as attachment in the Automation Policy e-mail in SMP 7.6?"

Mar 28, 2016 09:53 AM

Thx MyITGuy - yes i have it working would love to be able to put our logo in front just to give a bit more fizzaz as this email goes to other people in other companies.

we are company A that has a contract that Company B supports us. My report goes to them so this just being an attachment is really nice... hopefully i can get time to test out and try to get the logo going. I was googling and you can get the image converted to code (64bit or something like that) and embed it into html.... couldnt get that to work...

 

fyi my image above with green covering specific info.... was the attachment opened and screenshot of it taken overtop of the email so it wasnt the email with that info in it...

Mar 21, 2016 06:39 PM

This is how we accomplished the send CSV attachment.

  1. Clone the Send automation policy e-mail task. Name it, Send automation policy e-mail (CSV Attached).
  2. Replace the internal code with the following:
    NOTE: Leave To, Cc, Bcc, and Subject as they are.
     
    <!-- SMP:A;%!ReportName!%.csv -->
    %!ReportData!%
    <!-- SMP:B -->
    <HTML>
    <HEAD>
      <style type="text/css">
        body { font-size:9pt; font-family: verdana, sans-serif; }
        .titleBar { background-color:#ffdf5a; border: solid 1px #666; padding:0; margin-bottom:1em; }
        .padding1 { padding:3px; }
        .padding2 { padding:2px; }
        .logo { font-family: 'times new roman', serif; float:right; font-weight:bold; font-size:13pt; }
        .title { color:#666; font-size:16pt; }
        .header { border-top: solid 2px #8ca5c6; padding:0; font-family: verdana, sans-serif; font-size:8pt; font-weight:bold; background-color:#c0d3ed; }
        sub { font-family: verdana, sans-serif; font-size:5pt; }
      </style>
    </HEAD>
    <BODY>
      <div class="titleBar">
        <div class="padding1">
          <div class="logo">Symantec<sub>TM</sub></div>
          <div class="title">Automation Policy Message</div>
        </div>
      </div>
      <p>
        <b>%!ReportName!%</b>
        <br>
        %!ReportUrl!%
      </p>
      See the attached %!ReportName!%.csv file for results prepared at %!ReportTime!% or click the link above for the most current results.
    </BODY>
    </HTML>
  3. Create/Edit an Automation Policy
  4. Under Conditions, select Run for non-empty data from the dropdown menu
    NOTE: This is the only way to see Results as CSV.
  5. Under Actions, click the pencil icon next to Run job/task
  6. Locate and select the cloned task from Step 1, Send automation policy e-mail (CSV Attached)
  7. Under Actions, click Edit input parameter
  8. Fill in the To, Cc, and Subject as normal.
  9. For Report Name, choose Report Name
  10. For Report Data, choose Results as CSV
  11. For Report URL, choose Report URL
  12. For Report Time, choose Report Last Run

Cheers

 

Mar 18, 2016 10:46 AM

gave up.. maybe revisit another day...

so if you get bored and figure it out... Id love to hear how you did it!

Mar 18, 2016 09:59 AM

yeah not getting that to work yet... still chugging along.. 

Mar 18, 2016 09:40 AM

oooooh sweet.. next on my list..

 

so here is what I got.. now I understand you add to the report with

 

%!WhateverVariable!%

 

 

Legacy.jpg

Mar 18, 2016 09:40 AM

To get an image into the mail, I believe you either need to have the image on a share that the reciever have access to, or you have to embed it into the HTML code; http://www.techerator.com/2011/12/how-to-embed-images-directly-into-your-html/. Haven't tried it myself!

Mar 18, 2016 09:40 AM

I was refering to the input parameters on your automation task.  It should look something like this:

automationtask.PNG

Mar 18, 2016 09:27 AM

Not sure how you could embed it but you could certainly add an IMG tag to an externally hosted logo. 

Mar 18, 2016 09:05 AM

can you add a company logo into this? not sure if you can but hey gotta ask..

Mar 18, 2016 08:34 AM

ok yours is a clone of Send automated report email as mine was send automation policy email...

ok im getting closer... 

Mar 18, 2016 08:14 AM

@Joe,

        Thanks... I now have an attachment but not sure what you mean for " you want "Results as CSV" selected for the ReportData. "

 

my attachment is blank...but hey first step I have a csv attached!!!! 

Mar 18, 2016 07:39 AM

TeleFragger,

I have it working.  Below is the HTML code I'm using in my task.  Your automation policy looks right, you want "Results as CSV" selected for the ReportData.  

Hope this helps.  

<!-- SMP:A;report.csv -->
%!ReportData!%
<!-- SMP:B -->
<HTML>
<BODY style="font-size:9pt; font-family: verdana, sans-serif;">
   <table width="100%" border="0">
      <tr><td style="background-color:green; border: solid 1px green; padding:10; color:white; font-size:14pt;">
         ACME, Inc.
      </td></tr>
      <tr><td style="border: 0px #8ca5c6; padding:10; font-family: verdana, sans-serif; font-size:8pt; font-weight:bold;">   
         <table style="text-align:left; font-size:8pt;">      
            <tr>
              <th>Report:</th>
              <td><a href="%!ReportUrl!%">%!ReportName!%</a></td>
            </tr>
            <tr>
              <th>Report Time:</th>
              <td>%!ReportTime!%</td>
            </tr>
         </table>
      </td></tr>                     
      <tr><td>&nbsp;</td></tr>      
      <tr><td style="padding:0; font-family: verdana, sans-serif; font-size:8pt;">            
         See Attached CSV
      </td></tr>
      <tr><td>&nbsp;</td></tr>            
   </table>
</BODY>
</HTML>

 

Mar 18, 2016 04:09 AM

Hi TeleFragger,

In the parameter setup there is a "Message" field, but I cannot see a corresponding "%!Message!%" entry in the task.

When checking the Altiris logs, do you see any errors when running the policy?

/Andreas

Mar 17, 2016 05:24 PM

ok so I get it partially... 

you need to go clone the job/task which will allow you to edit it at that point.

I have done this.

and still no attachment. can you point me in where im doing wrong?

Attachment.jpg

 

attachment2.jpg

Mar 17, 2016 04:42 PM

So I am attempting this and lost where to enter this information.

is this where you create a new automation policy
Action - Send automation policy e-mail

then edit input parameter

 

I cant add more than one line to any of the options in there.

 

Related Entries and Links

No Related Resource entered.