Support Questions

Find answers, ask questions, and share your expertise

How to customize email subject in Apache NiFI Putemail processor?

avatar
Rising Star

I am running Apache NiFI. My use case is to monitor the file transfer process (GetFile to PutHDFS) and send an email whenever their is an error.

1 ACCEPTED SOLUTION

avatar
Rising Star

Hi,

the PutEmail Processor supports the NIFI expression language for the parameter Subject.

That means you can access all the attributes of your flow file and all your custom attributes or variables that you defined within the flow.

To have a custom subject in your PutEmail processor for the error-handling case, you should connect the PutHDFS (or GetFile or both) processor to the PutEmail Processor for the failure path and configure the PutEmail processor.

An example for a custom Subject could be:

'Hello from '${hostname}' the file '${filename}' caused an error at '${now}

More Examples and some guidelines for the Nifi Expression Language are listed here:

https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html

View solution in original post

4 REPLIES 4

avatar
Rising Star

Hi,

the PutEmail Processor supports the NIFI expression language for the parameter Subject.

That means you can access all the attributes of your flow file and all your custom attributes or variables that you defined within the flow.

To have a custom subject in your PutEmail processor for the error-handling case, you should connect the PutHDFS (or GetFile or both) processor to the PutEmail Processor for the failure path and configure the PutEmail processor.

An example for a custom Subject could be:

'Hello from '${hostname}' the file '${filename}' caused an error at '${now}

More Examples and some guidelines for the Nifi Expression Language are listed here:

https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html

avatar
Rising Star

Thanks for your reponse, it helped.

avatar
Rising Star

Glad that it helped. Could you please klick to accept the above answer, so that others see that this is the solution. Thanks! 🙂

avatar
Rising Star

Hi Peter,

I already did that. Am I still missing something?