Jump to content

Admin or customer don't recieve any order e-mails?


StreamAlex
 Share

Recommended Posts

When an order is placed the admin and customer should recieve an order confirmation e-mail, but they don't right now. I have tried changing "Order status for admin email notifications" to Pending and also tried both PHP mail() function and SMTP (with the correct configuration) as sending method. But nothing works, still no e-mails. Any idea of what could be wrong here?

 

I have noticed though that the newsletter works when I use PHP mail() function. But order e-mails are still not being sent.

 

CubeCart 5.2.8

PHP 5.3.3

Link to comment
Share on other sites

This is a bug(?) in CubeCart. (Maybe just an unfortunate programming decision.)

 

You cannot have a Newsletter template enabled at the same time as an Email template. There can be only one Email template enabled at a time: (a stock CubeCart) Default Emails or Default Newsletter.

 

/admin.php?_g=documents&node=email#email_templates

 

Please disable the Default Newsletter, enable the Default Emails, Save, and test.

Link to comment
Share on other sites

Tried it, but it didn't work.

 

I noticed though that there is no Email contents in Swedish (the language that I use in the store). Can this be the problem? Shouldn't it send out the English content if Swedish don't exist?

 

I also tried to add Email content in Swedish but I can't choose this language in the drop down with languages...

Link to comment
Share on other sites

"There is no Email contents in Swedish. Can this be the problem? Shouldn't it send out the English content if Swedish don't exist?"

 

An interesting question. I'll have to scan through the code.

 

Like the main language files, where there is a (default) definitions file that gets overwritten by a designated language pack, there is an email_definitions file. So I would assume that the phrases in the email_definitions would be used if there were no matching specific language phrase to overwrite them.

 

"Swedish (the language that I use in the store)"

 

Then you have created a Swedish language pack?

Link to comment
Share on other sites

"There is no Email contents in Swedish. Can this be the problem? Shouldn't it send out the English content if Swedish don't exist?"

 

An interesting question. I'll have to scan through the code.

 

 

 

"Swedish (the language that I use in the store)"

 

Then you have created a Swedish language pack?

I have sent you a private message with admin details. If it's possible that you can check the settings for me.

 

Yes, I have created Swedish in Languages in CC admin, and the phrases that I translate show correctly.

Link to comment
Share on other sites

  • 2 weeks later...

Since you are using CC528, we now have the ability to switch on debug info.

In the file mailer.class.php, on the blank line 34, add:
$this->SMTPDebug = 1; $this->Debugoutput = "html";
 

When you think CC should have sent an email, the Mailer code will send back to the browser any error messages.

 

 

Also:

If you understand English well enough, please try this: set your store's default language to English. Change an order to Processing or Completed. See if an English email gets sent out.

Link to comment
Share on other sites

Thank you for your reply.

 

I have both tried to add the Debug code to mailer.class.php and change language to English. But when I add debug code at line 34 nothing shows up after I have made an order in the store. And when I change default language in Store settings to English the language don't change in the store, it's still in Swedish, and no e-mails are sent out either. I have checked that the language is active in Languages and made new orders and changed status on old ones.

Link to comment
Share on other sites

Then, I think CubeCart is deciding, for some reason, that an email is not necessary.

 

If you wish to try this: You, as an administrator, may have your personal administrator settings set to show you Swedish. To verify this, log out as the administrator and close all your browser windows. Then, in a fresh browser window, visit your store (default set to English) and observe if the store is now in English.

 

In the folder /classes/phpMailer/, is there a file named PHPMailerAutoload.php? If not, you may have fetched a version of CC528 that accidentally left this file out of the package.

Link to comment
Share on other sites

I tried logging out and restart the browser and now the store is in English.

 

Yes, the file PHPMailerAutoload.php exist in the folder /classes/phpMailer. I have also tried both to use phpmailer and smtp to send the mails. I have also tried to change Store setting to send mails to admin in different order statuses.

Link to comment
Share on other sites

I looked at the admin Email Templates section and saw that there exists only three flags: US, France, and UK(I believe). I do not see a Swedish flag.

 

I will attempt to develop some instruction on how to get the email language file for Swedish (if there is one) loaded into CubeCart.

Link to comment
Share on other sites

According to my analysis of the code, every order has a language associated with it (the language the customer was using when the order was placed).

 

Unlike the main language packs, where any changes to the phrases in the language pack are databased, email phrases are databased in their entirety during CubeCart's installation.

 

The order management code (order.class.php) sends a request to Mailer->loadContent(message_type, language_of_order). Mailer attempts to load the message_type content in the given language from the database. If that fails (if there are no se-SE records in the Cubecart_email_content database table), CubeCart will go look for any email language packs that can be installed, and install them. Then CubeCart will try the Mailer->loadContent again.

Link to comment
Share on other sites

Please verify that you have this file:

/language/email_se-SE.xml, or

/language/email_se.xml

 

If so, we need to learn why CubeCart has not automatically imported it in to the database.

 

Perhaps the xml file is not correctly formatted, or does not have all the components.

Link to comment
Share on other sites

This is really weird. When I tried adding a swedish translation to the Email templates before today I couldn't, but when I tried 30 minutes ago I could. So I added Swedish translation for Admin: Order recieved and Cart: Order Confirmed. And now, when I try to add translation for the other Email Contents I can't choose Swedish again. The admins do get the correct Emails now when an order is placed though. The one I added translation for (Admin: Order recieved). But the customer still don't get any emails.

Link to comment
Share on other sites

"I copied email_en-US.xml and renamed it to email_sv-SE.xml and now it works! I just have to change all the phrases in it to swedish."

 

That won't work as you have planned it.

 

Once CubeCart determined that the email_sv-SE.xml file exists, its contents were loaded into the database. Editing the email_sv-SE.xml file will require you to force CubeCart to import that file into the database (updating what had already been loaded).

 

And when CubeCart has finally loaded the contents of email_sv-SE.xml into the database, the SE flag should automatically show in the list of email templates.

 

However, please verify that the filename is correct. sv is the two-letter code for El Salvador. Perhaps the filename should be email_se-SE.xml.

 

Then, we need to rename the image file for that country. In /language/flags, rename se.png to se-SE.png.

 

"The one I added translation for (Admin: Order recieved). But the customer still don't get any emails."

 

Based on what we have discovered, you will need to provide translations for the Cart:xx email templates and import them into the database.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...