Updating OH2 rule to work in OH3. Status report of items in a group

This is a variation of the battery notification email alert, where I have OH send me a daily email of the state of the following groups:

GroupStatus = items in this group are switches and can be ON or OFF.
GroupTempReport = item in this group are the current temperatures of appliances.

I get this error:

 failed: var String message = "\n"

When attempting to run this rule in OH3:

type: application/vnd.openhab.dsl.rule

var String message = "\n"
val report1 = GroupTempReport.allMembers.map[name + ": " + state.format("%s")].join("\n")
if (! GroupStatus.allMembers.filter([state == "OFF"]).empty) {
  val report = GroupStatus.allMembers.filter([state == "OFF"]).map[
    name + ": " + state.format("%s")
  ].join("\n")
  message =  message + " Openhab Items Offline:\n" + report+ "\n\n" + " Openhab Temperatures:\n" + report1
} else {
  message = message + " All items Online" + " Openhab Temperatures:\n" + report1
}
logInfo("Status Update:", "Message: [{}]", message)
sendMail("me@gmail.com", "OpenHAB Status Message", message)

In file based rules it does not make any problems. Is your header/trigger section of your GUI based rule valid?

Anyway, you will not see anything in your log file as it only gives out the first line (which is empty)

var String message = "\n"
...
logInfo("Status Update:", "Message: [{}]", message)

This was the issue. I was attempting to run the rule without a trigger. I am still feeling my way around OH3 GUI and the transition from OH2 leads me into some of these skipped steps. Thank you. I’ll post the whole setup in an Rules example post.

Thank you.

An example of daily status report email here.