Hi
So far I figured out how to send an E-Mail that includes an attachment. e.g.
$props = ['to' => $to, ...];
$props['attachments'] = [ kirby()->root('assets') .'/event.ics' ];
kirby()->email($props);
The same works for an image:
$props = ['to' => $to, ...];
$props['attachments'] = [ page()->file('pic.jpg') ];
kirby()->email($props);
However, in this case the image appears at the bottom of the e-mail.
I’d rather place it at the top, though.
To achieve that, I’d have to use an image tag inside the mail body like
<img src="cid:my-img" alt="Logo">
where ‘my-img’ shows up in the embedded attachment as an additional header element, like
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=img.jpg
Content-Type: image/jpeg; name="img.jpg"
Content-Id: <my-img>
(In addition, the ‘Content-Disposition:’ needs to be change from ‘attachment‘ to ‘inline’.)
Is it possible to achieve this with Kirby’s built in Email class?
If not, can somebody point to to an alternative solution?
Thanks!