Skip to main content
Question

attach multiple log files to 1 emailer


tnarladni
Enthusiast
Forum|alt.badge.img+16

I need some help with a problem I have about sending out log files from FME server jobs. I have a workspace that runs a bunch of jobs using the fmeserverjobsubmitter. if it fails, I capture the log file from that job to a network location. then I send an email with the log files attached using the Emailer. only problem is if multiple jobs failed. it will send multiple emails which I don't want it to do. i also do not want to bundle up the logs files as 1 zip file. I used the featureWriter to write out a txt file of all the log file paths and then the featureReader to read it back, but not sure how to attach it as the attachment parameter expect just 1 file path. TIA!

5 replies

Forum|alt.badge.img
  • October 30, 2017

If you publish the Attachments parameter (ATTACHMENTTABLE), add a couple files and run the workspace, you'll have the required syntax to pass more than one file.

C:\apps\FME17.1-32-b17539\fme.exe E:\FME_TEMP\wb-xlate-1509381727869_31592
          --ATTACHMENTTABLE "E:<backslash>FME_TEMP<backslash>My<space>Log<space>Files<backslash>1.jpg 1 image/jpeg E:<backslash>FME_TEMP<backslash>My<space>Log<space>Files<backslash>2.log 2 autodetect"

The only complex thing you have to do is to encode the path to the files with <backslash> and <space> and maybe any other characters to be encoded.

There may be a TCL or Python call to encode the path using FME functions.

To publish the Attachments parameter, in the navigator window (1), open the Emailer properties (2) and right-click on the Attachments Really parameter and select Create User Parameter...

0684Q00000ArJvpQAF.png

This will add a published parameter that you can use to select the files to attach.

0684Q00000ArJTRQA3.png

At this point, if you run the workspace, you'll have in the log window the information I displayed above.

Then, you are ready to use your workspace and attach any number of files to your email by supplying a correct value to the ATTACHMENTTABLE parameter.


tnarladni
Enthusiast
Forum|alt.badge.img+16
  • Author
  • Enthusiast
  • October 30, 2017
larry wrote:

If you publish the Attachments parameter (ATTACHMENTTABLE), add a couple files and run the workspace, you'll have the required syntax to pass more than one file.

C:\apps\FME17.1-32-b17539\fme.exe E:\FME_TEMP\wb-xlate-1509381727869_31592
          --ATTACHMENTTABLE "E:<backslash>FME_TEMP<backslash>My<space>Log<space>Files<backslash>1.jpg 1 image/jpeg E:<backslash>FME_TEMP<backslash>My<space>Log<space>Files<backslash>2.log 2 autodetect"

The only complex thing you have to do is to encode the path to the files with <backslash> and <space> and maybe any other characters to be encoded.

There may be a TCL or Python call to encode the path using FME functions.

To publish the Attachments parameter, in the navigator window (1), open the Emailer properties (2) and right-click on the Attachments Really parameter and select Create User Parameter...

0684Q00000ArJvpQAF.png

This will add a published parameter that you can use to select the files to attach.

0684Q00000ArJTRQA3.png

At this point, if you run the workspace, you'll have in the log window the information I displayed above.

Then, you are ready to use your workspace and attach any number of files to your email by supplying a correct value to the ATTACHMENTTABLE parameter.

@larryI don't understand what you mean by publishing the attachments parameter? where is that parameter? I tried to find it on safe.com and was only able to find the relationship class. Could you send a sample fmw for me to see this?

 


richardatsafe
Safer
Forum|alt.badge.img+10

Hi @tnarladni,

In the event you are running the job on FME Server you could also use the FMEServerEmailGenerator and send a list comma separated URL's as one attribute, after you have used an Aggregator to aggregate all the fails into one feature.

https://knowledge.safe.com/content/kbentry/55594/workflow-management-example-multiple-engines.html

https://knowledge.safe.com/articles/578/sending-email-part-5-sending-an-email-with-attachm-1.html


Forum|alt.badge.img
  • November 2, 2017
tnarladni wrote:
@larryI don't understand what you mean by publishing the attachments parameter? where is that parameter? I tried to find it on safe.com and was only able to find the relationship class. Could you send a sample fmw for me to see this?

 

@tnarladni, I updated my answer to add details on how to publish the parameter.

 


tnarladni
Enthusiast
Forum|alt.badge.img+16
  • Author
  • Enthusiast
  • November 2, 2017
larry wrote:

If you publish the Attachments parameter (ATTACHMENTTABLE), add a couple files and run the workspace, you'll have the required syntax to pass more than one file.

C:\apps\FME17.1-32-b17539\fme.exe E:\FME_TEMP\wb-xlate-1509381727869_31592
          --ATTACHMENTTABLE "E:<backslash>FME_TEMP<backslash>My<space>Log<space>Files<backslash>1.jpg 1 image/jpeg E:<backslash>FME_TEMP<backslash>My<space>Log<space>Files<backslash>2.log 2 autodetect"

The only complex thing you have to do is to encode the path to the files with <backslash> and <space> and maybe any other characters to be encoded.

There may be a TCL or Python call to encode the path using FME functions.

To publish the Attachments parameter, in the navigator window (1), open the Emailer properties (2) and right-click on the Attachments Really parameter and select Create User Parameter...

0684Q00000ArJvpQAF.png

This will add a published parameter that you can use to select the files to attach.

0684Q00000ArJTRQA3.png

At this point, if you run the workspace, you'll have in the log window the information I displayed above.

Then, you are ready to use your workspace and attach any number of files to your email by supplying a correct value to the ATTACHMENTTABLE parameter.

@larry brilliant. Cheers mate. 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings