In app/code/core/Mage/Sales/Model/Order.php
find sendNewOrderEmail()
method. Then find
$mailer->setTemplateParams(array(
'order' => $this,
'billing' => $this->getBillingAddress(),
'payment_html' => $paymentBlockHtml
)
);
Here is array of variables from template. Add one new param for test:
'test' => $is_test ? $is_test : ''
Change $is_test
to your condition. For example:
public function sendNewOrderEmail($is_test = FALSE)
Now open your template file app/locale/en_US/template/email/sales/order_new_guest.html
(for example).
Find subject variable on the first line: <!--@subject Nuovo ordine # {{var order.increment_id}} @-->
or something like this.
Make changes:
<!--@subject {{var is_test}}Nuovo ordine # {{var order.increment_id}} @-->
Call method:
$order->sendNewOrderEmail('TEST - ');