Cannot attach file for email notification

Hi all,

I’ve tried several scripts to attach an MP4 to an email notification. However it keeps returning the same error:

extra keys not allowed @ data['file']

Script 1:

  alias: Camera Email Script
  sequence:
    - service: shell_command.garden_camera_shell_script
    - delay:
          seconds: 1
    - service: notify.gmail
      data:
          title: 'Camera Footage'
          message: 'Camera Footage'
          data:
              data: 
                  - /config/temp/garden_camera/garden_camera.mp4

Script 2

  alias: Camera Email Script
  sequence:
  - data: {}
    service: shell_command.front_camera_shell_script
  - service: shell_command.garden_camera_shell_script
  - delay: '00:01:00'
  - data:
      data:
        file: '/config/temp/garden_camera/garden_camera.mp4'
      message: Camera footage.
      title: ALERT - Camera Footage
    service: notify.gmail

Script 3:

  action:  
     - service: notify.gmail
       data:
        title: Doorbell Rang
        message: DOORBELL RANG
        data:
         file:
          path: /config/blueiris/front.jpg

I have tried creating these as scripts and automations but I’m not having any luck.

Could someone tell me what I am doing wrong or perhaps show me examples of where you have it working please so I may copy?

Thanks.

Presuming you’re using smtp, according to the docs you can’t add attachments, you can only add inline images…