How to send picture from MotionEye as an attachment

The problem: when door sensor is triggered (door opened), I send notification via e-mail. However, I would also like to send still image (JPEG) attachment captured from motionEye camera 2 via e-mail.

The problem is, I do not know where to get the image. Snapshot URL is in form: http://xx.xx.xx.xxx:8123/api/hassio_ingress/XyXyXy/picture/2/current/?_username=xxx&_signature=yyy

If I try to open this URL in different browser it says 401: Unauthorized.

So how to “grab” the image and send it as an attachment? And alternatively, how to grab image after lets say 10 seconds after door sensor is triggered and sent it as an attachment?

Here is my automation:

alias: Door notification
description: 'Door notification'
trigger:
  - platform: state
    to: 'on'
    from: 'off'
    entity_id: binary_sensor.lumi_lumi_sensor_magnet_aq2_on_off
condition: []
action:
  - service: notify.send_email
    data:
      message: >-
        Door opened at {{ now().strftime('%H:%M:%S')}}
      title: Door
mode: single

Oh, and another question… how do I send an email with two or more lines?

This of course doesn’t work:


      message: >
        Ob {{now().strftime('%H:%M:%S')}} - door opened
        Line2
        Line 3