Needs review
Project:
Mass Contact
Version:
8.x-1.0-beta2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
8 Dec 2018 at 00:26 UTC
Updated:
2 Jul 2020 at 09:57 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
manishsaharan commentedNow I can easily send attachments of file of type [csv, xlsx, xlx, jpg, jpeg, png, txt].
Comment #4
tjtj commentedYou do need to install Mimemail to get this to work, even on Drupal 8.7. And you should add pdf, doc, docx to the patch list of allowed files.
Comment #5
embeau commentedI tried manishsaharan29497's patch, but it wasn't working for me and didn't include all the features I required.
So I took manishsaharan29497's patch as a starting point and built off of that to create a new patch with a few more features.
First, I updated the Email body settings page (found at /admin/config/mass-contact/settings/body) to include an Attachments area. Here, the user is able to input via the UI the upload destination (public or private), the file directory, the allowed file extensions, and the max upload size.
Then, I updated the mass contact form itself. I allow for multiple file attachments and validate the size and extension.
Upon submitting the form, I loop through the array of attached files to get the necessary data for each to send along with the rest of the message.
I left some todos in EmailBodyForm.php regarding validation of the user input for the various settings. If anyone has some guidance on how to go about doing this, please let me know.
Comment #6
gaurav.kapoor commentedComment #7
gaurav.kapoor commented@embeau and @manishsaharan29497 thanks for working on this feature. The patch will require slight modifications, testing, and some of the tests will have to be changed as well.
I will work on this issue.