Failing to attach snapshot from cam to email

I’ve seen this discussed before but am havign no luck. I’ve an automation that is supposed to email me a cam snapshot when a seperate motion sensor is triggered (I’ve tried the blueprint but it uses a push notification and I can’t see the photos as they are too small in the HA app notification and i can’t zoom in!).

My Automation tests Ok , just missing the photo! I get emails with nothing in them (except the text).

This is the automation:

alias: test shed motion email
description: ""
trigger:
  - type: turned_on
    platform: device
    device_id: 5d7f041c91854e6ad552b92e13c06cd1
    entity_id: binary_sensor.shed_motion_sensor_sensor_state_any
    domain: binary_sensor
condition: []
action:
  - service: camera.snapshot
    data:
      filename: /tmp/snapshot.jpg
    target:
      entity_id: camera.nvr_sub_3
  - service: notify.email_roger_gmail
    data:
      message: Motion Detected in Mail room
      title: Motion Detected in Mail room
      data:
        images:
          - /tmp/snapshot.jpeg
mode: single

I’ve also put this in configuration.yaml

homeassistant:
  allowlist_external_dirs:
    - "/tmp"`

Not sure how to troubleshoot this as I can’t tell if a snapshot file is being generated! don’t know where to look. The cam entity works fine - I have it on my dashboard

A little update - I’m using File editor to poke around and I’ve found config/www/tmp folder

In it is a camera snapshot from a few days ago when it was triggered by the blueprint I have for sending a notification to the HA phone app with the image. It only works occasionally (the image is missing most of the time… this could be very telling…).

I’ve tried triggering several snapshots but the folder stubbornly only has the old photo in it.

Solved it! I change the jpeg path to

/config/www/tmp/snapshot.jpg

And it works!

I assumed , after seeing so many references to /tmp that you didn’t need to spell out the whole path.