VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: gripped on May 02, 2014, 01:04:38 AM

Title: [Solved] Emails sent from admin panel aren't getting the data needed
Post by: gripped on May 02, 2014, 01:04:38 AM
I recently migrated from 1.1.9 to 2.6.0

I used daycounts excellent Virtuemart 2 Migrator.
Any way I had tested before I went live but I missed something and it's too late to go back.

All order emails that are automatically generated seem to be fine.
But when changing the status of an order from the 'Orders' page with 'notify shopper' selected I get emails that seem to have not converted language strings and or accessed data

I'll show an example.
I do have a few language overrides but disabling made no difference.
And I made a quick duplicate test site and reverted to the original straxx template to make sure my template (shape5 vertex) overrides weren't at fault (though I didn't really think they could be) but it's the same.

Any ideas ?
Could be a good few beers in it for anyone who points me in the right direction.
The website is www.ecigsoutlet.co.uk (http://www.ecigsoutlet.co.uk)

(http://www.ecigsoutlet.co.uk/images/email.png)
Title: Re: Emails sent from admin panel aren't getting the data needed
Post by: AH on May 02, 2014, 09:31:50 AM
This happened to me during trial migrations

It was because I had introduced new variable names in base VM 1.1.9

These were stored as "new" fields in VM

However the quick solution is to add the variables show as new language items using a joomla language override

COM_VIRTUEMART_MAIL_SHOPPER_YOUR_ORDER: ORDER #

instructions are here

http://docs.virtuemart.net/tutorials/33-templating-layouts/107-customization-of-displayed-text.html (http://docs.virtuemart.net/tutorials/33-templating-layouts/107-customization-of-displayed-text.html)
Title: Re: Emails sent from admin panel aren't getting the data needed
Post by: gripped on May 02, 2014, 14:12:24 PM
Thanks for the response.

But either I'm not understanding you or it's not quite that.

I've done a diff on the installed components/com_virtuemart/language/en-GB tree & the same tree extracted from the installation zip (VirtueMart2.6.0_Joomla_2.5.19-Stable-Full_Package.zip) and they are identical.

I tried putting a couple of the problem language items in  language/overrides/en-GB.override.ini
COM_VIRTUEMART_MAIL_SHOPPER_NAME="Hello %1$s,"
COM_VIRTUEMART_MAIL_SHOPPER_YOUR_ORDER="Your order number: "


But they still don't show correctly.

It seems like just this file , components/com_virtuemart/views/productdetails/tmpl/mail_html_notify.php , is failing to look for the right language items as the other language item  in the email, which are referenced from different php files, display correctly.
And I don't understand why the items show correctly when the confirmation email is automatically sent , but if I change the status to shipped and then back to confirmed both the 'shipped' and 'confirmed' emails are wrong.

Edited to add

QuoteIt was because I had introduced new variable names in base VM 1.1.9

These were stored as "new" fields in VM

Where were the new fields stored ?
Title: Re: Emails sent from admin panel aren't getting the data needed
Post by: GJC Web Design on May 02, 2014, 15:43:39 PM
All very odd - on 2.6.0

COM_VIRTUEMART_MAIL_SHOPPER_YOUR_ORDER="Your order number: "  exists on line 187 of en-GB.com_virtuemart.ini

it is only called in mail_html_shopper.php & mail_raw_shopper.php  in views/invoice/tmpl/

as the header says it is -> Layout for the shopper mail, when he confirmed an ordner

the mail_html_notify.php in product_details is the  -> Renders the email for the shoppers from the waiting list, or who bought this product

updating an order status should just trigger the same views/invoice/tmpl/mail_html_shopper.php  mail  as there are no other there that I see..

does this musing help?...  ;)
Title: Re: Emails sent from admin panel aren't getting the data needed
Post by: gripped on May 02, 2014, 16:03:24 PM
Quote from: GJC Web Design on May 02, 2014, 15:43:39 PM

does this musing help?...  ;)

Any ideas help  ;)

But I am aware of the files you mention. Like you say it should trigger the same but it doesn't.
My hunch is that when the emails are generated from the orders page the 'language' is either not set or set incorrectly. Just a hunch and I'm not sure how I can see the URL's being passed internally. I guess I'll have to learn about debugging.

I have a test copy of the site so I tried installing en-US and setting that as default for the administration and frontend.
But the issue remained.

As a workaround I have bought and installed ccvaom.
With this I can now notify customers about shipped orders without error's in the email.

But I would still like to get to the bottom of the issue.
Title: Re: Emails sent from admin panel aren't getting the data needed
Post by: GJC Web Design on May 02, 2014, 16:33:35 PM
to debug your situation (I tested the scenario on a clean install and my emails were fine)  look in the admin-> models/orders.php

function notifyCustomer() around line 1490

this hands off to shopfunctionsf.php in the frontend helpers

function renderMail()  line 204

BTW - the invoice template is used no matter what the status is
Title: Re: Emails sent from admin panel aren't getting the data needed
Post by: gripped on May 02, 2014, 20:24:20 PM
OK , Getting weird now

I thought I'd retrace my steps to see where the error was introduced.

Installed VirtueMart2.6.0_Joomla_2.5.19-Stable-Full_Package.zip to a clean dir and new database.
Choose en-GB as the language.

Made one order from the sample data. No other changes at all. Changed the order to shipped.
Result below. :(

There's nothing unusual I can think of about my server.
Debian wheezy LAMP

Quote[image removed by moderator because the linked image required authentication/login at the site it was hosted on]

So either VM 2.6.0 has a bug or (more likely) my server is mis-configured.

Any more ideas ?
Title: Re: Emails sent from admin panel aren't getting the data needed
Post by: jenkinhill on May 03, 2014, 11:12:02 AM
Quote from: gripped on May 02, 2014, 20:24:20 PM
There's nothing unusual I can think of about my server.
Debian wheezy LAMP

What PHP version is installed? One of those strange Debian builds?

I have been able to duplicate your issue with the full VM2.6/Joomla package but not with any other 2.6 installations that I have tested.
Title: Re: Emails sent from admin panel aren't getting the data needed
Post by: jenkinhill on May 03, 2014, 13:11:21 PM
OK temporary fix for this is to upload a copy of en-GB.com_virtuemart.ini into language/en-GB/  - VM2.6 should be looking in components/com_virtuemart/language/en-GB for that file, but in the case of the emails it is not. There is a change in language file handling in VM2.6, and hopefully this will be fixed with a couple of other nuisance bugs in VM2.6a
Title: Re: Emails sent from admin panel aren't getting the data needed
Post by: gripped on May 03, 2014, 13:49:54 PM
That's fixed it  :)

Simple when you know how !

Thanks