Jump to content

PDF invoice attached in email to shipped status - send email to admin too -


rob84

Recommended Posts

Hello. I have this code that works good in classes/Mail.php for sending e-mail to customer with attached invoice when order status changes to "Shipped" :

if (strpos($template, 'shipped')){
    $id_factura = $templateVars['{id_order}'];
    $orden = new Order($id_factura);
    $factura['content'] = PDF::invoice($orden, 'S');
    $factura['name'] = $id_factura.'.pdf';
    $factura['mime'] = 'application/pdf';
    $message->attach(new Swift_Message_Attachment($factura['content'], $factura['name'], $factura['mime']));
    
   }

Now I need that the same e-mail should be sent to store admin too. Which function to use to send this email?

Thanks.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

It is responsibility of the mailalerts module. Try to find an answer in the code.

 

Can be done adding a string in classes/Mail.php just under the line:

$message->attach(new Swift_Message_Attachment($factura['content'], $factura['name'], $factura['mime']));

?

 

Thanks.

Link to comment
Share on other sites

  • 2 months later...

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...