Read txt file


Is it possible with the exec binding to read a txt file?

I have a rulle where I want to read the content of a txt file and use it as a body for a e-mail.

Using Jython, you could use something like…

email_body = open("/path/to/file.txt", "r")

In case you would like to use the exec binding or command line you could use

mail -s "xxx" < /path_to/body.txt

You need to make sure that the program mail is installed.
It can be installed e.g. by installing mailutils package assumed that you are on a linux distribution this provides that package.

In Rules DSL probably the simplest is

val body = executeCommandLine("cat /path/to/body.txt", 1000)