ndiaga 339 Posted October 18, 2016 (edited) Ok, Here is how I did it: in the function Main::send() , attachement is in the 9 position, variable number 9. So in mailalerts count till variable 9 wich correspond to null by default. And then use this: // Join PDF invoice $id_order_state = Configuration::get('PS_OS_ERROR'); $order_status = new OrderState((int)$id_order_state, (int)$this->context->language->id); if ((int)Configuration::get('PS_INVOICE') && $order_status->invoice && $order->invoice_number) { $pdf = new PDF($order->getInvoicesCollection(), PDF::TEMPLATE_INVOICE, $this->context->smarty); $file_attachement['content'] = $pdf->render(false); $file_attachement['name'] = Configuration::get('PS_INVOICE_PREFIX', (int)$order->id_lang, null, $order->id_shop).sprintf('%06d', $order->invoice_number).'.pdf'; $file_attachement['mime'] = 'application/pdf'; } else { $file_attachement =null; } //So change myfile.pdf to your file name. //And here you go: if ($dir_mail) Mail::Send( $mail_id_lang, 'new_order', sprintf(Mail::l('New order : #%d - %s', $mail_id_lang), $order->id, $order->reference), $template_vars, $merchant_mail, null, $configuration['PS_SHOP_EMAIL'], $configuration['PS_SHOP_NAME'], $attach, null, $dir_mail, null, $id_shop ); I just relaced the null to $attach . Here is the function that sends mails with all its variables: /** * Send Email * * @param int $id_lang Language of the email (to translate the template) * @param string $template Template: the name of template not be a var but a string ! * @param string $subject * @param string $template_vars * @param string $to * @param string $to_name * @param string $from * @param string $from_name * @param array $file_attachment Array with three parameters (content, mime and name). You can use an array of array to attach multiple files * @param bool $modeSMTP * @param string $template_path * @param bool $die * @param string $bcc Bcc recipient */ Mail::Send($id_lang, $template, $subject, $template_vars, $to, $to_name = null, $from = null, $from_name = null, $file_attachment = null, $mode_smtp = null, $template_path = _PS_MAIL_DIR_, $die = false, $id_shop = null, $bcc = null); So we are dealing with: $file_attachment = null, Edited October 21, 2016 by ndiaga (see edit history) Share this post Link to post Share on other sites