2

I am working with a client who is primarily wholesale, the subject line needs to focus on things like shipping method and warehouse information than about the order id or the web URL of the store.

I am trying to find any ways of achieving this.

4

You can include in the subject any variable you pass to the template. You can try to include this in the order e-mail subject

{{var order.getShippingDescription()}}

I'm not sure how it will behave with if it has tags in it.
If that doesn't work, you can override the sendNewOrderEmail and sendOrderUpdateEmail to pass additional parameters to the template and use them in the subject.
[EDIT]
For example the variables are passed in the sendNewOrderEmail method like this:

$mailer->setTemplateParams(array(
        'order'        => $this,
        'billing'      => $this->getBillingAddress(),
        'payment_html' => $paymentBlockHtml
    )
);

Anything you add in that array you will be able to use in the template as variable. If you make the code above look like:

$mailer->setTemplateParams(array(
        'order'        => $this,
        'billing'      => $this->getBillingAddress(),
        'payment_html' => $paymentBlockHtml
        'foo'          => 'bar'
    )
);

You will be able to use in the template {{var foo}} and get the value bar.

3
  • Thanks for that, can you kindly also point me in the right direction to any pointers where I can find instructions on how to add variables to the template?
    – skv
    Sep 9 '13 at 19:35
  • @skv. See my updated answer
    – Marius
    Sep 9 '13 at 19:40
  • Thanks a lot... that helps a me both understand and solve this issue
    – skv
    Sep 9 '13 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.