Is there any way to send single invoice email that will have different order/invoice details like Invoice #0000085-89 via a single email.
1 Answer
Here is the code, you have to add your data or orders details in $html file and then send it.
<?php
$html="<p>Here is some content</p>";
$mail = Mage::getModel('core/email');
$mail->setToName('Your Name'); //send the name
$mail->setToEmail('Your Email'); //Set email
$mail->setBody($html);
$mail->setSubject('Mail Subject'); //Set email subject
$mail->setFromEmail('Sender Mail Id'); //Set email from
$mail->setFromName("From Name"); //Set from name
$mail->setType('html'); // You can use Html or text as Mail format
try {
$mail->send(); //To send email
Mage::getSingleton('core/session')->addSuccess('Email Sent Successfully');
}
catch (Exception $e) {
Mage::getSingleton('core/session')->addError('Unable to send.');
}
?>