How to include webcam image with smtp automation

I have a webcam pointed at my gate. I also have a sensor that triggers when a car passes the gate. I have HA detecting the sensor, and it sends me an SMS message (via SMTP to my phone number) whenever the sensor is triggered.

What I want is to capture an image from the webcam and include it in the message when this happens. I have a URL which will fetch and return a single image from the camera, but if I use that in the “images” section of the automation, it doesn’t work. (I tested it with a static image file and it does work with that, so I know my syntax is ok.)

Is there a way to include a real-time snapshot from the webcam with an SMTP automation?

I was able to accomplish what I wanted by following these instructions:
https://seanb.co.uk/2017/11/camera-snapshots-updated/