Skip to main content
Solved

Emailer Mime Type - Custom filename

  • July 14, 2020
  • 1 reply
  • 22 views

Forum|alt.badge.img

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

 

 

Best answer by chrisatsafe

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.

View original
Did this help you find an answer to your question?

1 reply

chrisatsafe
Contributor
Forum|alt.badge.img+2
  • Contributor
  • Best Answer
  • July 14, 2020

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.


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