How do I add 'elements:' in domain templates?

Hello!

Are there any guidelines about working with ‘elements:’ entry in domain templates?

I have a custom OutputChannel to which I need to provide some additional information associated with utterances. I figured that I could add ‘elements:’ entry to templates and define send_custom_message(), but there is a minor inconvenience: Dispatcher doesn’t pass ‘text:’ entry to send_custom_message(), only ‘elements:’. Because of this, I need to define the template in the following way so that I could read the text from ‘elements:’:

utter_hello:
   - text: "Hello!"
     elements:
     - text: "Hello!"
       my_additional_element: "True"

instead of desired

utter_hello:
   - text: "Hello!"
     elements:
     - my_additional_element: "True"

I don’t like the duplication, but I would really like to process both ‘text:’ and 'elements:". How do I supplement templates with ‘elements:’ correctly?

Were you ever able to figure this out? I’m having a similar problem. I need to send back an additional argument in the response to my chatbot’s frontend and I figured elements is the way to do it. But now I have to send all the buttons as elements too and instead of a key:value pair each button just becomes a long string