Attachment integration for MimeMail module style does not work

Created on 5 October 2023, about 1 year ago
Updated 12 September 2024, 2 months ago

Problem/Motivation

Sendgrid module manages by default email attachments in a different way than MimeMail module.
However, it provides a secondary way to accept attachments declared in the same way as they are in MimeMail to increase the module compatibility.

We had a project where we used attachments in MimeMail, but once we moved into Sendgrid, they stopped working.

According to SendgridMail.php, it expects $message['params']['attachments'][0]['uri']. Nevertheless, the expected format according to MimeMail docs β†’ is $message['params']['attachments'][0]['filepath'].

That's why attachments stops working.

Steps to reproduce

Declare an email attachment in MimeMail expected format

$message['params']['attachments'] = [
      [
        'filepath' => $filepath,
        'filemime' => 'application/pdf',
      ],
    ]

Send the email and confirm that attachment does not work.

Proposed resolution

Modify the current logic and use "filepath" instead of "uri"

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain plopesc Valladolid

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024