Skip to main content
JonnyL
Gold ⭐️
July 9, 2020
Solved

NiFi - How to put Flowfile Content into PutEmail message body

I have a line by line list in my flowfile, which records the result of some file processing, somthing like the following;

 

C:\Data\client1\order100.txt - SUCCESS

C:\Data\client1\order122.txt - ERROR

C:\Data\client1\order323.txt - SUCCESS

 

I can't see a way to add this flowfile content to the e-mail MessageBody.

 

I have therefore tried an ExtractText processor with message.body as an attribute and (.*) as the regex. This gets me close, but all the filenames are on the same line, so I end up with this;

 

C:\Data\client1\order100.txt - SUCCESS C:\Data\client1\order122.txt - ERROR C:\Data\client1\order323.txt - SUCCESS

 

Which is not quite the e-mail I'm looking for. Any sensible suggestions welcome.

 

 

 

JonnyL
JonnyLAnswer
Gold ⭐️
July 9, 2020

Actually I just put it into the mail as it was.

 

Then when the mail arrives, all the newlines are there..!

 

Its just that the attribute doesn't render the newlines...

 

Problem solved.

2 replies

JonnyL
JonnyLAuthorAnswer
Gold ⭐️
July 9, 2020

Actually I just put it into the mail as it was.

 

Then when the mail arrives, all the newlines are there..!

 

Its just that the attribute doesn't render the newlines...

 

Problem solved.

Translate
cjervis
Community Manager
Community Manager
July 13, 2020

I'm happy to see you resolved your issue. Please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. 

 

Screen Shot 2019-08-06 at 1.54.47 PM.pngmark as solution button

Translate
Keep the questions coming