MQTT Payload as part of an email

I’m currently running Blue Iris with Deepstack AI and a MQTT server on HomeAssistant.

Whenever there’s motion, Deepstack can detect what it is (if there’s a person, dog, cat, etc etc in the pictire) and sends that to my HomeAssistant using an MQTT if there is a confirmed presence. The topic varies from camera to camera and the payload changes depending on what was detected.

I have an automation set up to take a snapshot, notify my phone and send an email whenever a person is detected, but I’m wanting to do this for multiple cameras and multiple payloads, each being different.

Besides making an automation for each variable, is there a way to include an MQTT payload into a message sent?

Example:

A PERSON has been detected at the FRONT DOOR
or
A DOG had been detected OUT BACK

An example automation I have for sending a notification is as follows…

alias: 'AI Notify: Porch'
description: 'Sends a notification and an email'
trigger:
  - platform: mqtt
    topic: ai/Porch/motion
condition: []
action:
  - service: telegram_bot.send_message
    data:
      message: Someone is detected on the porch!
  - service: camera.snapshot
    data:
      filename: /tmp/porchtemp.jpg
    entity_id: camera.porch
  - service: notify.mobile_app_iphone_12_pro_max
    data:
      message: Person dectected on the Porch!
  - service: notify.gmail
    data:
      data:
        images:
          - /tmp/porchtemp.jpg
      message: >-
        Someone was detected on the porch at {{ as_timestamp(now()) |
        timestamp_custom('%I:%M%p', true) }}.

I would like for it to be something like this but I’m not sure if it’s even possible

alias: 'AI Notify'
description: 'Sends a notification and an email'
trigger:
  - platform: mqtt
    topic: ai/**TOPIC**/motion
condition: []
action:
  - service: telegram_bot.send_message
    data:
      message: **PAYLOAD** is detected on **TOPIC**!
  - service: camera.snapshot
    data:
      filename: /tmp/image.jpg
    entity_id: camera.**TOPIC**
  - service: notify.mobile_app_iphone_12_pro_max
    data:
      message: **PAYLOAD** dectected **TOPIC**
  - service: notify.gmail
    data:
      data:
        images:
          - /tmp/temp.jpg
      message: >-
        **PAYLOAD** was detected on **TOPIC** at {{ as_timestamp(now()) |
        timestamp_custom('%I:%M%p', true) }}.

OR at the very least just being able to change the PAYLOAD text. I’m perfectly fine with making one automation per camera