Jump to content

Archived

This topic is now archived and is closed to further replies.

multimixer

Email issues

Recommended Posts

I worked out some solutions for mails, they are already posted all around the forum, now I want to share them in a organized way. I hope somebody will find this useful.

 

A. How to get a notification when a person register.

 

1) Set up the "extra order emails" feature in Admin/my store

 

2) In file catalog/create_account.php

 

Find the lines

email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
     tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

Place after

 // BOF multimixer 24.6.2009 send emails to other people
     $owners_text = EMAIL_TEXT_OWNER_INFO . "\r\n" .EMAIL_TEXT_CUSTOMER_NAME . ' ' . $name . "\r\n" . EMAIL_TEXT_CUSTOMER_EMAIL . ' ' .  $email_address . "\r\n" . EMAIL_TEXT_CUSTOMER_PHONE . ' ' . $telephone . "\r\n" . EMAIL_TEXT_CUSTOMER_ADDRESS . ' ' . $street_address . "\r\n" . EMAIL_TEXT_CUSTOMER_CITY . ' ' . $city . "\r\n" . EMAIL_TEXT_CUSTOMER_STATE . ' ' . $state . "\r\n" . EMAIL_TEXT_CUSTOMER_COUNTRY . ' ' . $country;

     if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
   tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_OWNER_SUBJECT, $owners_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
    }

    // EOF multimixer

 

3) In file catalog/includes/laguages/yourlanguage/create_account.php

 

Put before the end

// mm 24.6.09
define('EMAIL_OWNER_SUBJECT', 'New registration' );
define('EMAIL_TEXT_OWNER_INFO', 'New customer registration, find details below:');
define('EMAIL_TEXT_CUSTOMER_NAME', 'Name:' );
define('EMAIL_TEXT_CUSTOMER_EMAIL', 'email:' );
define('EMAIL_TEXT_CUSTOMER_PHONE', 'Phone:' );
define('EMAIL_TEXT_CUSTOMER_ADDRESS', 'Address:');
define('EMAIL_TEXT_CUSTOMER_CITY', 'City:' );
define('EMAIL_TEXT_CUSTOMER_STATE', 'State:');
define('EMAIL_TEXT_CUSTOMER_COUNTRY', 'Country:');

This will send an email to the additional email as set in admin for every new customer registration.

 

Because you don't want to read each time the "hello bla bla" text that the customer receives, it contains just the useful information, name, email etc

 

This has been working for me for quite awhile (with UHTML email installed too) until just recently.

 

Now I receive this:

 

New customer registration, find details below:

Name:

email: zakkaryd@hotmail.com

Phone: 5415301462

Address: 1864 Thomas st #16

City: Coos Bay

State:

Country: 223

 

Notice there's no name or state.

 

At the same time I am now experiencing problems with the Order Process email (handled by UHTML email).

It is missing the customers name after the word Dear,

Also missing the order #, Delivery & Billing addresses.

 

I found a thread that discussed the UHTML problem, pointing it to a PayPal issue.

Unfortunately it referred to PayPal Standard and not my PayPal IPN (files don't match).

 

I would appreciate any help!


- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Share this post


Link to post
Share on other sites

Hi,

 

I have a very strange mail issue. When I create a new customer account (for a test purpose) I don't get any email about it. (I checked the test user mailbox). But when I ordered any or I sent mail via admin part of store or I used the forgotten password function the test user get the emails.

I tested it with yahoo, gmail too.

 

here is the code (the original) from create_account.php:

 


// build the message content
     $name = $firstname . ' ' . $lastname;

     if (ACCOUNT_GENDER == 'true') {
        if ($gender == 'm') {
          $email_text = sprintf(EMAIL_GREET_MR, $lastname);
        } else {
          $email_text = sprintf(EMAIL_GREET_MS, $lastname);
        }
     } else {
       $email_text = sprintf(EMAIL_GREET_NONE, $firstname);
     }

     $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;


     tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

    tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
   }
 }

 

For test I post the value of $name, $email_address and $email_text and all variables contain values.

 

Has anyone any idea what I did wrong?

 

Thank you!

Share this post


Link to post
Share on other sites

is there a way in 2.3.1 to insert a right column box or module that allows a site visitor to send a tell a friend email, not necessarily about a product (as it already happens on product pages,) but to send the site's url to someone the visitor thinks might be of use to a potential visitor?

 

Thanks,

 

Timmy C

Share this post


Link to post
Share on other sites

Hi,

 

I have a very strange mail issue. When I create a new customer account (for a test purpose) I don't get any email about it. (I checked the test user mailbox). But when I ordered any or I sent mail via admin part of store or I used the forgotten password function the test user get the emails.

I tested it with yahoo, gmail too.

 

here is the code (the original) from create_account.php:

 


// build the message content
     $name = $firstname . ' ' . $lastname;

     if (ACCOUNT_GENDER == 'true') {
        if ($gender == 'm') {
          $email_text = sprintf(EMAIL_GREET_MR, $lastname);
        } else {
          $email_text = sprintf(EMAIL_GREET_MS, $lastname);
        }
     } else {
       $email_text = sprintf(EMAIL_GREET_NONE, $firstname);
     }

     $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;


     tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

    tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
   }
 }

 

For test I post the value of $name, $email_address and $email_text and all variables contain values.

 

Has anyone any idea what I did wrong?

 

Thank you!

 

Has anyone , any idea ? Thank you!

Share this post


Link to post
Share on other sites

Hi George.

I am about to convert my shop to use UTF-8.

 

I have done a lot of reading especially wrt to email and tested some "solutions" which did not work.

 

So, I would like to have your suggestions on how to get it working.

 

Many thanks for this brilliant thread. :)

 

Sara

Share this post


Link to post
Share on other sites

Hi George, thank you for answering.

On the catalog side the e-mails received do not contain characters like å ä ö.

When I check the contact_us page by trying to e-mail again (within the time limit) the reposted e-mail contains diamonds instead of å ä ö.

So, the underlying functions for insert text_area etc., do not get the right encoding.

 

On the admin side (sending newsletter) the reply is "email sent to:" but no recipient shows on that line, further no e-mail is received.

 

What I would be happy with is the php standard mb_mail function, which at the most can have 5 parameters.

 

All code pages, language files and the db is in utf-8, and I do have the correct meta tag, plus this line at the bottom of application_top:

 

//REF: http://www.w3.org/International/questions/qa-html-encoding-declarations#httpheadwhat

header('Content-type: text/html; charset=utf-8');

 

So, the problem lies within the osCommerce code...

 

Hopefully Greece will find a way out of the crises...

 

Sara

Share this post


Link to post
Share on other sites

Sara, what exactly is the problem?

 

Hello George, hopefully you know how to fix this:

 

Costumers order confirmation are all ok.

 

But, the extra order email is not. The to: field just look like this: =?utf-8?B??=

 

And that's very strange since both uses tep_mail

 

Hoping for help

Sara

Share this post


Link to post
Share on other sites

Please help : My password forgotten page is not working. After sending request email are not coming to customer and stil it is showing emails are sent. Please tell me how to solve this issue.

Share this post


Link to post
Share on other sites

Hi,

 

I do have a problem with outgoing emails from osCommerce, non of them works. Contact, order confirmation, password forgotten, emails through admin etc. So, i do not get info via email or my customers doesn't either... I had a version 2.2 and thought that updating it for 2.3.1 would fix the problem, but it didn't. So, I'm running version 2.3.1 currently.

 

Please help!

Share this post


Link to post
Share on other sites

Hi There

 

As others have indicated: This is a brilliant thread - "well done!" to the helpful gurus. :)

 

I have been contacted by a store owner (I installed and host the store, oscommerce v2.2 RC2) because they have been experiencing a strange email problem. To save you all time, I have spent some hours first searching about on this forum, but so far have not found anything that indicates anyone else has had or solved this weird issue.

 

The store owner is getting an email from oscommerce when a customer orders. So far so good. But when the customer has previously ordered, the email she receives has the order details of the PREVIOUS order. It was not until the goods were sent and a customer rang to say she'd already received this order, and wanted her new order, that the shop owner was alerted. This has happened several times. In the latest incident, the store owner recognised the items as having been recently packed and posted, and so rang the customer to get their new order that way.

 

I had sent some test orders at the time of setting this up back in May 2010. Today, I logged in as the same person and put in an order, then logged out. Then using a different browser I logged in again and ordered different items. However, the resulting emails (both customer and store owner) were correct in both instances. So my test did not duplicate the issue.

 

Any insight into what might be going on here, and how to fix it?

 

Store is at http://sissi.com.au/shop

 

Thanks heaps.

 

Mr Fair Go

Share this post


Link to post
Share on other sites

Hi there,

 

most of my customers are not receiving the "order confirmation" email if their email address are from gmail, yahoo and few others. if their email address is xxx@me.com (apple's icloud), they receive the "order confirmation" email.

 

my store uses the same email address as it's domain and receives all the "order confirmation" email. no issue here. but some of my customers don't.

 

from my store, i can send email to all the customers manually including those with gmail, yahoo addresses and they receive the email. only the "order confirmation" that is automatically generated are not sent to some customers.

 

some external mail server hosts are blocking my store auto generated "order confirmation" emails.

need some advice on how to debug this problem.

 

thank you in advance

 

rgds

garychua

Share this post


Link to post
Share on other sites

This query takes the customer name from "table_orders" of your DB

		$check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
	$check_status = tep_db_fetch_array($check_status_query);

 

To get just the first name, you need to change this, to get the first name from "table_customers" ie

c.customers_firstname (look at other queries about how they separate what data from what table, and how they connect different id's (ie the order_id and customers_id)

 

and then just do a

$customers_firstname = $check_status ['customers_firstname'];

, place it before the tep mail function and then replace there the $customers_name with $customers_firstname

 

I'm sorry that I do not post the complete lines of code, it's because of lack of time, maybe later I will do and post. If you succeed to do, then it would be great to post it here

 

Hi George,

 

Thank you for your excellent post about Email here, which can help me to modified the quotation email I mentioned in other post

http://forums.oscommerce.com/topic/389975-form-sql-table/

 

I have question about the php code to retrive database:

Since I made extra database tables, and hope to save the customer who is not registered and ask for quote to quote_customer (exactly the same name and structure, just I add quote_ to table and each field), can you please explain me how the code working?

 

if (tep_session_is_registered('customer_id')) {
  $account_query = tep_db_query("select customers_firstname, customers_lastname, customers_telephone, customers_id, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
  $account = tep_db_fetch_array($account_query);
  $name = $account['customers_firstname'].' '. $account['customers_lastname'] ;
  $email = $account['customers_email_address'] ;
  $phone = $account['customers_telephone'] ; 

 

what are

1.

$account_query = tep_db_query () ---> does it mean to get customer information from table_customer?

2.

$account = tep_db_fetch_array($account_query); ---> does it always come after 1. $account_query = tep_db_query () ?

3.

so what if I want to save new quote customer inforamtion he/she fill in back to the quote_customer table? what is the code I need to change to?

4.

if the customer is register, it will get information from table_customer,

does it mean I can put

} else { .....

and ask quote customer to fill in the fileds?

 

Sorry the questions I ask maybe sound silly but I dont know know SQL very well, just like I did not know oscommerce at all at the beginning, big learning for me though this forums.

Share this post


Link to post
Share on other sites

Hello Multimixer

I want to send emails with attachment from "admin/orders.php" and I have not found a way to do it.

I have searched Add-ons and I not found anything.

 

At first seems easy, but do not know where to start.

 

Thank you very much in advance.

 

Osc version : 2.2 MS 2

Share this post


Link to post
Share on other sites

Hey George,

 

I have member approval running on OSC 2.3.3 and PHP 5.4, when and email is sent from create_account.php in the header of the subject line, listed in this code $name, does not show up in the subject line. it is blank, everything gets inserted into the data base.

 

   $admin_email_text = $company . "\n\n" .
					   $firstname . " " .
					   $lastname . "\n\n" .
					   $street_address . "\n" .
					   $city . " " . $state . " " . $postcode . "\n" .
					   $telephone . "\n" .
					   $email_address . "\n\n" .
					   ADMIN_EMAIL_WELCOME . ADMIN_EMAIL_TEXT . EMAIL_WARNING;
   $admin_subject = sprintf(ADMIN_EMAIL_SUBJECT, $name );
   tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $admin_subject, sprintf($admin_email_text, $name), STORE_OWNER, EMAIL_FROM, '');
//-Member Approval v1.5.1
  tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));

 

$name is put together here

 

 $name = $firstname . ' ' . $lastname;

 

 

can you tell me why the subject line only reads "Login Application from" ?

 

 

any help would be appreciated.

 

thanks

Sandwick

Share this post


Link to post
Share on other sites

I am having an email problem I was hoping someone could help me with. I can send out emails and everyone receives emails, except when they put their email address in the forgotten password field. Does anyone have any ideas about this? I'd really appreciate any help. Thanks!

Share this post


Link to post
Share on other sites

Hi

I got a problem with emails send to customers when update order in admin section to despatched or any other status where customer should by inform

email is not send

but I can send email from admin section and from contact us as well without and problems

 

I got a problem with paypal ipn as well and when order is made shop send multiple email to customer XD lets say like 10 with same order id and only charge once but thats issue with paypal

and is in other topic but still need find out why Osc dont send status chenge in orders

Regards

Share this post


Link to post
Share on other sites

still have problems receiving emails from contatc us and order notification

using a new installed osc 2.33

Share this post


Link to post
Share on other sites

I'm having a problem with the order confirmation email that is sent once the Barclays epdq integration plugin is installed. Before, when I was testing it on the default OSC payment module of cash on delivery, I switched email config to come through in html not plain text and stylised the email just as I wanted it. However, as soon as I had the Barclays module integrated, the confirmation email is now sent in plain text only and so my formatting is ignored. I haven't switched emails to plain text in the OSC admin area but that's what's happening for just that one email. Does anyone have any ideas?

Share this post


Link to post
Share on other sites

Hi, I noticed my 'order emails' had stopped arriving, and it turns out my customers weren't getting them either, which was something of a problem as I'd 'cloned' the cheque payment option, and inserted my bank details so they could make a manual bank transfer. After some messing about and experimentation (and lots of reading of this thread), the problem did in fact seem to be with the host. I have an aol email I've had for years that customers know, and had been using that.

 

If emails suddenly stop going/coming try the following.

 

Go to your domain control panel. Create a email account, something like: orders@mydomain.com add a forwarder from this email to wherever you like email to go for me: myemailaddress@@aol.com

In your store interface admin/mystore , change you 'email address' and 'emails' from to orders@mydomain.com, I Also set up the 'extra emails' to: myemailaddress@@aol.com

 

Works fine now. I get emails, customer gets emails. Hope that helps anyone who is stuck on the basic problem.


Running a botched up version of  osCommerce Online Merchant v2.3.4 bootstrap with the dresscode theme installed, numerous add-ons, terrible coding, terrible website, but will have to make do until I have made up for my losses and can risk shutting down for a couple of weeks while I start all over again. - I did not install my program but am endeavouring to fix it with your help.

Share this post


Link to post
Share on other sites

this does not work for me. I installed a fresh OSC on a different sever with no templates what so ever and it works just fine.

 

when i go to use my current OSC store with the fancy template, i see that the web address is different when you hit the SUBMIT button

http://www.dailydrivenmotoring.com/test/contact_us.php?action=send

look at the address

http://dailydrivenmotoring.com/contact_us.php/action/success

Share this post


Link to post
Share on other sites

@@webguy_ddm  The second store is using a URL rewriter. Turn that off. It may be "Use Search Engine Safe URLs" in your Admin >> Configuration >> My Store, or it may be one that you have installed.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

@@webguy_ddm  The second store is using a URL rewriter. Turn that off. It may be "Use Search Engine Safe URLs" in your Admin >> Configuration >> My Store, or it may be one that you have installed.

 

Regards

Jim

Jim, I made the change, thanks - Now I am still waiting on the email to be sent from my server to my email on both admin and FORGOT PASSWORD.

 

UPDATE - I went back to my CONTACT US page and tried to re-use the page, and got this error

Error: An enquiry has already been sent. Please try again in 15 minutes.

Share this post


Link to post
Share on other sites

×