Hi Jerome,
but why is the emai not created. My plugin creates a pdf invoice and sends it via email:
Some extract:
class plgHikashopAsado_invoice extends JPlugin {
....
function onAfterOrderUpdate(&$order, &$send_email) {
if ($order->order_status == 'confirmed') {
$mailer = JFactory::getMailer ();
// set sender & recipient
$mailer->setSender ( $order->mail->from_email );
....
// sending the email
$send = $mailer->Send ();
if ($send) {
JFactory::getApplication ()->enqueueMessage ( 'A mail was send.' );
} else {
JFactory::getApplication ()->enqueueMessage ( 'The billing email could not be send.', 'error' );
return false;
}
}
}
As I mention, it works completly fine if I switch the order state in the backend.
Thanks,
Dirk