Send all host attributes in NotificationCommand?

Referencing Object Types - Icinga 2 , I have a NotificationCommand that looks like this:

env = {
  ICINGA_HOSTNAME = "$host.name$"
  ICINGA_HOSTOUTPUT = "$host.output$"
  ICINGA_HOSTSTATE = "$host.state$"
  # ... dozens of more lines...
}

Is there any way I can replace this with a for loop or such that would give me access to ALL of the host attributes - configuration and runtime - such that I could dynamically add them to the env? I can be flexible with the resulting key names. I’d then want to do the same for services.

I feel like I’d be able to do this in other languages, but I guess i don’t have a proper understanding of the data types, contexts, and evaluation order here to know if this is even possible. I did try adding a for loop to read from host, but get an error:

critical/config: Error: Error while evaluating expression: Tried to access undefined script variable 'host'

… and trying to use macro("$host$") results in a “Invalid field access” error.

Given how it looks like this is implemented at icinga2/host.cpp at master · Icinga/icinga2 · GitHub and associated files, it appears there is no common collection type of the available attributes implemented. I.E., unless a specific attribute name is searched for and hits a match in an if/else block, there’s no getting anything back. Please let me know if I’m missing something here.