Ios notification failure capture

Hi all,

Every now and then, I find that a notification to be sent to my phone (iOS) fails to send (out of phone range, phone is off at night, etc). I’d like to be able to send an email in the case of a failed delivery as a fall-back option.

At present, I can capture the moment when a notification fails, and send an email using the following code chunk:

# NOTIFY APP/EMAIL WHEN A SERVICE ERROR OCCURS IN THE HOMEASSISTANT LOGS (to alert of a failure that I may not want to have missed!)
# requires the following in configuration.yaml:
# system_log: 
#   fire_event: true
- alias: "Create notifications for errors"
  initial_state: 'on'
  mode: single
  max_exceeded: silent
    platform: event
    event_type: system_log_event
    condition: template
    value_template: '{{ "Error sending notification" in[0] }}'
    # HA notification center
    - service: persistent_notification.create
        title: A Service has errored and generated a log message
        message: "{{[0] }}"
    # email notification
    - service: notify.notify_email
        title: "Alert: A Service has errored and generated a log message"
        message: "{{[0] }}"

However, this doesn’t inform me as to WHAT the original notification actually was! (title and content). Is it possible to capture this information and send as an email, in a similar fashion to above?

Thanks in advance!

Note, the current implementation as above generates a message like this:

Error sending notification to ContentTypeError(RequestInfo(url=URL(''), method='POST', headers=<CIMultiDictProxy('Host': '', 'User-Agent': 'HomeAssistant/2021.9.7 aiohttp/3.7.4.post0 Python/3.8', 'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Content-Length': '363', 'Content-Type': 'application/json')>, real_url=URL(''))... etc, etc, etc