- Issue created by @minoroffense
When preparing an email with an attachment using mimemail, we may want to send the file as a different filename from that on the server. And since the filename is used in the guessing of the mimetime, it should allow the mimetype to be set as well.
Currently the filename isn't set correctly because the code is using the wrong array key, and the filemime is not overriddable at all.
When preparing an emali using mime mail and mail manager:
$result = $this->mailManager->mail(
'mymodule',
'mymodule_mailtemplate',
$pdf_recipient,
$pdf_language,
[
'attachments' => [
[
'filename' => 'history.pdf',
'filepath' => $pdfFileRealPath,
'filemime' => 'application/pdf',
],
],
'requester_email' => $data['email'],
'request_hash' => $request_hash,
],
FALSE
);
And we set the filemime and filename we want (which are different than the file that was generated on the server).
Active
2.0
Code