- πΊπ¦Ukraine i-trokhanenko Lutsk πΊπ¦
MR #3 - https://git.drupalcode.org/project/mail_safety/-/merge_requests/3.diff solves the issue for me. Thanks for the patch. Making RTBC!
- π§πͺBelgium flyke
I had this error after updating mail_safety module.
We programmatically add an attachment to an email via hook_mail.
Initially we used this bit of code for that:$attachment = (object) [ 'filename' => $file->getFilename(), 'uri' => $file->getFileUri(), 'filemime' => $file->getMimeType(), ]; $message['params']['files'][] = $attachment;
After receiving the error, we also tried it like this:
$message['params']['files'][] = file_get_contents($file->getFileUri());
And like this:
$message['params']['files'][] = file_get_contents(\Drupal::service('file_system')->realpath($file->getFileUri()));
But the error remained.I can confirm that MR #3 solves the issue.
BUT you must uninstall and the reinstall the mail_safety module. This is important for the patch to work as it applies to the hook_install of the module! - πΊπΈUnited States TolstoyDotCom L.A.
I created this for the 8.2 version: https://www.drupal.org/project/mail_safety/issues/3380292 π Change 'mail' column to be a blob Needs review
- π¬π§United Kingdom the_g_bomb
Is it worth closing this issue, seeing as the latest version implemented the change?