Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Form Attachment Processing With Php Rate Topic   - - - - -

 
  • Fedor
  • Senior Member
  • Members
  • Join Date: 25-Feb 13
  • 158 posts

Posted 09 January 2018 - 11:41 AM #1

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?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 16,142 posts

Posted 09 January 2018 - 01:07 PM #2

Yes, it can work with attachments

 

http://prntscr.com/hy11pt


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия

 
  • Fedor
  • Senior Member
  • Members
  • Join Date: 25-Feb 13
  • 158 posts

Posted 10 January 2018 - 07:16 AM #3

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.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 16,142 posts

Posted 10 January 2018 - 01:13 PM #4

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия

 
  • Fedor
  • Senior Member
  • Members
  • Join Date: 25-Feb 13
  • 158 posts

Posted 12 January 2018 - 09:27 AM #5

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



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 16,142 posts

Posted 15 January 2018 - 05:32 AM #6

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
)

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия