Form Attachment Processing With Php

Can Mailer class by standard process HTML form attachments?

Alternatively, I know that in CS-Cart's forms produced by Form Builder the attachments are processed by JS. Could this mechanism be re-used in the custom-built form within Cs-Cart?

Yes, it can work with attachments

http://prntscr.com/hy11pt

Thanks eCom. What I actually meant is using it outside of the form builder, building custom form based on the standard one (eg. sending to multiple mails, customizing auto-confirmation etc.)

I managed to re-use and modify the Mailer function in app/controllers/frontend to process all the fields apart of attachments.

Thanks eCom. What I actually meant is using it outside of the form builder, building custom form based on the standard one (eg. sending to multiple mails, customizing auto-confirmation etc.)

I managed to re-use and modify the Mailer function in app/controllers/frontend to process all the fields apart of attachments.


When the $mailer->send method is called, you can use the attachments array. Format can be checked in the Form builder module, just use it as example

http://prntscr.com/hyi6ay

I actually used Mailer::sendMail method. Not sure what's the difference, but does the array provide ability to process attachments?

I actually used Mailer::sendMail method. Not sure what's the difference, but does the array provide ability to process attachments?

Yes, first argument is array with parameters. You should add the attachments element to this array. Format should be

array(
    'file_name_1' => PATH_TO_FILE_1,
    'file_name_2' => PATH_TO_FILE_2,
    'file_name_3' => PATH_TO_FILE_3
)