Jump to content

AdminOrders message to customer - attach file


Recommended Posts

I thought that I had seen this solution somewhere, but I've searched and can't find it so I'll ask

I would like the ability to send a message to the customer using the adminorders tab. That I know how to do, but I would also like to attach a document with that message. We work with some businesses that require a certain form to be filled out by us, if we can attach it to the message telling them the document is ready that we currently send from our adminorders screen it would save another email being generated. We enter the document number in the adminorders screen so there is a record of that number that is associated with the order. I attached screen shots if they help

20838_DNstRUE6kFoYrAkTxZJZ_t

20839_aQVH0GlMYxrQSPrs7z1A_t

Link to comment
Share on other sites

  • 3 weeks later...

I have a feeling it has something to do with these lines...

$message->message = htmlentities(Tools::getValue('message'), ENT_COMPAT, 'UTF-8'); 



'{message}' => (Configuration::get('PS_MAIL_TYPE') == 2 ? $message->message : nl2br2($message->message))



in that section I think something like this needs to be added, but nothing I've tried yet has worked...

$message->userfile1 = htmlentities(Tools::getValue('userfile1'), ENT_COMPAT, 'UTF-8'); 



'{userfile1}' => (Configuration::get('PS_MAIL_TYPE') == 2 ? $userfile1->userfile1 : nl2br2($userfile1->userfile1))



Then in order_merchant_comment.html {userfile1} needs to be added in. This is where I'm caught up too. Is there a header code for attachments instead of dropping that {userfile1} just in the body.

Link to comment
Share on other sites

I still haven't foud.
I think, a part of the answer is around lin 164

if (Mail::Send(intval($order->id_lang), 'order_merchant_comment', $title, $varsTpl, $customer->email, $customer->firstname.' '.$customer->lastname))

You can have a look at this :
http://www.phpcs.com/code.aspx?ID=22574

It's in french : the php form copy the file on the server, then attach it to the mail and delete the file on the server
i've tried it works, but how to include it in Prestashop ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...