Modify a text block

Hello,
I want to send an eMail if the battery status of one of my (many) sensors gets lower than a predefined limit.

What do I have:
I defined a ‘numeric_input’ helper for the limit and created an automation with triggers for all my sensors. Each trigger has its own Id.
I also can send mails.

What do I want:
I want one action which modifies a text template, which is used as message of the mail, to see, which sensor fires the trigger.

I can do this by creating lot of actions sending the correct text message with cut’n’paste in .yaml-ditor, but this is dumb.

I am a newbee to HA and need a pointer to a more elegant solution.

Thanks for helping.

Gerhard

Is this any help?

Thanks, but maybe some breaking changes to HA happend in the meanwhile.
Using this idea I got:

Error rendering data template: UndefinedError: ‘dict object’ has no attribute ‘to_state’

I created the trigger condition using the UI and here the ‘-platform’ clause is missing …

With best regards

Gerhard