Solved

Emailer Mime Type - Custom filename

  • 14 July 2020
  • 1 reply
  • 4 views

Badge

I want to email a file attachment but the filename is passed through a custom value:-

@Value(_dataset)/litmap-@DateTimeFormat(@DateTimeNow(), %B-%d-%Y).csv

When I enter this in the Emailer transformer it goes red as per the screenshot but I cannot see how to read the error. And also cannot see how to set mime type as text/csv

 

 

icon

Best answer by chrisatsafe 14 July 2020, 19:52

View original

1 reply

Badge +2

Hi @davebarter,

I think your best option is to create a temp attribute using either an AttributeManger or on the previous transformer by right clicking on one of the transformer output ports and choosing add attribute:

Then set the attribute value to your path value: @Value(_dataset)/litmap-@DateTimeFormat(@DateTimeNow(), %B-%d-%Y).csv

Then set the source file parameter to the attribute you just created - this will allow you to use the autodetect MIME type.

The reason it is being flagged as invalid is because this parameter is looking for a file on your machine unless an attribute value is selected. Since the @datetime functions are taken literally, the path it is looking for C:/../litmap-@DateTimeFormat(@DateTimeNow(), %B-%d-%Y).csv instead of C:/../litmap-July-14-2020.csv. Since the path does not exist, the parameter is being flagged as invalid. This behaves just like the filename (existing) parameter.

Reply