Author Topic: [Solved] Emails sent from admin panel aren't getting the data needed  (Read 2986 times)

gripped

  • Beginner
  • *
  • Posts: 40
    • ecigsoulet
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


AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3510
  • VirtueMart Version: 3.8.9
Re: Emails sent from admin panel aren't getting the data needed
« Reply #1 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
Regards
A

Joomla 3.9.27
php 7.4

gripped

  • Beginner
  • *
  • Posts: 40
    • ecigsoulet
Re: Emails sent from admin panel aren't getting the data needed
« Reply #2 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
Code: [Select]
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

Quote
It 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 ?

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10693
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
Re: Emails sent from admin panel aren't getting the data needed
« Reply #3 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?...  ;)
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

gripped

  • Beginner
  • *
  • Posts: 40
    • ecigsoulet
Re: Emails sent from admin panel aren't getting the data needed
« Reply #4 on: May 02, 2014, 16:03:24 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.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10693
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
Re: Emails sent from admin panel aren't getting the data needed
« Reply #5 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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

gripped

  • Beginner
  • *
  • Posts: 40
    • ecigsoulet
Re: Emails sent from admin panel aren't getting the data needed
« Reply #6 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 ?

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28464
  • Always on vacation
    • Jenkin Hill Internet
Re: Emails sent from admin panel aren't getting the data needed
« Reply #7 on: May 03, 2014, 11:12:02 am »
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.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 4.0.12 10777  J 3.10.11 PHP 7.4.30

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28464
  • Always on vacation
    • Jenkin Hill Internet
Re: Emails sent from admin panel aren't getting the data needed
« Reply #8 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
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 4.0.12 10777  J 3.10.11 PHP 7.4.30

gripped

  • Beginner
  • *
  • Posts: 40
    • ecigsoulet
Re: Emails sent from admin panel aren't getting the data needed
« Reply #9 on: May 03, 2014, 13:49:54 pm »
That's fixed it  :)

Simple when you know how !

Thanks