AutoEmailer
#41
Posted 05 January 2006, 09:38
Slowly it is beginning to work... I'll list all changes later. I have the following problems now:
1/ I have finally received the message with subject Happy Birthday jesus only because there is a real customer named Jesus in database having birthday today. If there was nobody with the birthday, I would not receive test message.
2/ if I select Customers & Announce in settings and call the script from my browser, I receive the birthday message for Jesus (she's having birthday) and I can see that customers.csv is being written in auto_emailer folder. However one hour later the file contains only 20 records and browser is still working / loading - the script is not executed yet. We only have about 3000 customers in shop.
3/ if I select Customers & New Products and set the date in New Products to 1st November 2005, I received about 1800 emails (one for each customer) with the list of products - and because we use four languages in our shop, each product description is repeated 4 times in the message body - which could be considered as spam by many. Is there a way to
a/ receive 1 email only for testing purposes?
b/ use 1 description from 1 language only?
c/ use title and shorter description (cca 150-200)? Something that would look like:
Product title
Description, bla, blah, blah... click here for more - this could be the link to a product
Alex
#42
Posted 05 January 2006, 14:20
2 - I don't know what this might be. It shouldn't take that long. I suppose it may be timing out due to a limit on how long a script can run on yur server. If you can create a test site and only run with a few customers, that might help find the problem.
3 - To only send one email, in the auto_emailer/auto_newproducts.php file, after
$tmessage->Send();add
breakl
Yes. The product link is already planned for the next release.
Jack
Most Important: Header Tags SEO - Ultimate SEO V 2.2d
All SEO Addons: Recommended SEO Addons
Support Links:
Finding relevant link exchanges - Headers Already Sent - What does it cost? -What's my version? - How to change titles? - Preventing HotLinking
#43
Posted 05 January 2006, 15:54
breaklI received no emails at all.
When I select Orders and Announce in settings, no email for orders is received when I call the script from my browser, I receive Happy Birthday email only. I have inserted
echo 'test emial'."\n";in auto_orders.php but still, received no message.
New Products - is there any chance of including description in one language only?
Just for verification, when I'm done with testing, do I keep the recepiant's email address in auto_emailer.php empty as follows? Or both empty?
//Set some common items $Sender = 'admin@mysite.com'; $Recipiant = '';
Thanks for your time.
Alex
#44
Posted 05 January 2006, 17:19
For the orders problem, be sure to insert the echo statement somewhere outside of any conditions code. For example, find this line:
$total = 0;and place teh echo statement after it. If that doesn't work, create a test file containing the following:
<?php echo 'test'."\r\n"; ?>Name it whatever you want and create a cron job for it. If you don't receive an eamil, then you have some other problem not related to AutoEmailer and you will need to fix that first.
For the language problem, find this line in auto_newproducts.php
$new_products_query = mysql_query("select p.products_id, p.products_image, p.products_tax_class_id, pd.products_id, pd.products_name, pd.products_description, p.products_date_added, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products p left join products_description pd on p.products_id = pd.products_id left join specials s on p.products_id = s.products_id where products_status = '1' and p.products_date_added >= ' . $date_added . ' order by p.products_date_added desc");and change it to $new_products_query = mysql_query("select p.products_id, p.products_image, p.products_tax_class_id, pd.products_id, pd.products_name, pd.products_description, p.products_date_added, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products p left join products_description pd on p.products_id = pd.products_id left join specials s on p.products_id = s.products_id where products_status = '1' and p.products_date_added >= ' . $date_added . ' and language_id = ' . 1 . ' order by p.products_date_added desc");I haven't tested this but it should work. Change the 1 to whatever language you want.That recepiate is a global one meant for all modules. It is overridden in the modules that send out emails to customers. In modules like auto_orders.php, it is used snce the email is only going to you. So it should be set to your email address (or wherever you want).
Jack
Most Important: Header Tags SEO - Ultimate SEO V 2.2d
All SEO Addons: Recommended SEO Addons
Support Links:
Finding relevant link exchanges - Headers Already Sent - What does it cost? -What's my version? - How to change titles? - Preventing HotLinking
#45
Posted 06 January 2006, 18:24
<?php echo 'test'."\r\n"; ?>When I call it from browser, it displays test on the screen. I created cron job for it and received email from cron with "test" in the message body. Therefore cron job is fine and only this path is working for me (I use plesk):
php -q /home/httpd/vhosts/mysite.com/httpdocs/admin/auto_emailer/auto_emailer.phpHowever when I insert
echo 'test emial'."\n";in auto_orders.php after $total = 0; it does nothing nor I receive any email with orders.
When I insert break; after $tmessage->Send(); in auto_emailer/auto_newproducts.php, I receive no email. When I delete it, I receive one for each customer, which is annoying, even if I set the date in New Products to yesterday, I still receive hundreds of emails.
After inserting language_id = ' . 1 . ' in mysql_query produced no products nor descriptions in email. I have tried to change it to pd.language_id = ' . 1 . ' and p.language_id = ' . 1 . ' and pd.language_id = '" . (int)$languages_id . "' but nothing works. All I receive is the following message:
Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 8bit <html> <head> <title>New products</title> </head> <body> <p>Hello Justin,<br><br> <!-- start message //--> We are just letting you know of the great new products that recently arrived. Just look at some of the <strong>great items</strong> we now offer: <!-- stop message //--> <br><br> <br> </p> </body> </html>Note that the above message is not html formated. I receive it exactly as it looks.
I have also received the following message from cron, I think it might be related to auto_orders.php
PHP Parse error: parse error, unexpected ',' in /home/httpd/vhosts/mysite.com/httpdocs/admin/auto_emailer/auto_orders.php on line 28
I am aware Jack that this is time consuming for you, I'm just trying to help making this good contribution better, if it doesn't work for me, I'm sure it will not work for many others. I'll be therefore more than happy to help debugging it.
Alex
#46
Posted 07 January 2006, 01:32
Jack
Most Important: Header Tags SEO - Ultimate SEO V 2.2d
All SEO Addons: Recommended SEO Addons
Support Links:
Finding relevant link exchanges - Headers Already Sent - What does it cost? -What's my version? - How to change titles? - Preventing HotLinking
#47
Posted 07 January 2006, 14:56
auto_emailer.php with include('auto_orders.php'); produced the following error:
PHP Parse error: parse error, unexpected ',' in /home/httpd/vhosts/mysite.com/httpdocs/admin/auto_emailer/auto_orders.php on line 28this is line 28 of auto_orders.php
// Start csv header $_csv_data='.','.'Order Status'.','.'Customer'.','.'Quantity'.','.'Product'.','.'Price' ."\n";It doesn't look right to me... that line is being changed when selecting boxes in admin/auto_emailer_orders.php. When I used clean file from install package, I received no more erros, however if I call the script from my browser, it keeps loading, orders.csv is being written in a folder on the server, but it only contains headers of columns... same problem as I have with customers. It should take few seconds to execute that script, but it's taking ages and it's never finished.
Alex
#48
Posted 07 January 2006, 18:20
<?php
/*
$Id$
AutoEmailer by Jack_mcs at www.oscommerce-solution.com
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2002 osCommerce
Released under the GNU General Public License
*/
$message = '
<html>
<head>
<title>Orders Report</title>
</head>
<body>
<p><table width="100%" border="1">
<tr>
<!-- Start Header //-->
<th width="15%">Customer</th><th width="15%">Quantity</th><th width="15%">Product</th><th width="15%">Price</th><th width="15%">Weight</th>
<!-- Stop Header //-->
</tr>';
$Subject = 'Orders Report for ' . $currentDate;
$tmessage = new Email($Recipiant, $Sender, $Subject, $CustomHeaders);
$tmessage->Cc = $Cc;
$tmessage->Bcc = $Bcc;
// Start Order Status
$ordersStatus = 'Processing';
// Stop Order Status
$total = 0;
$customers_query = mysql_query("select customers_id from customers") or die(mysql_error());
$message .= '</tr>
<tr>
<!-- Start Totals //-->
<td>Total </td>
<!-- Stop Totals //-->
</p>
</body>
</html>
';
$tmessage->SetHtmlContent($message);
$pathToServerFile = $_file;
$serverFileMimeType = 'application/excel';
$tmessage->SetFileContent($pathToServerFile, $serverFileMimeType);
$tmessage->Send();
fclose( $_fp );
?>
Jack
Most Important: Header Tags SEO - Ultimate SEO V 2.2d
All SEO Addons: Recommended SEO Addons
Support Links:
Finding relevant link exchanges - Headers Already Sent - What does it cost? -What's my version? - How to change titles? - Preventing HotLinking
#49
Posted 08 January 2006, 10:22
I tested it with the above file and it works fine, a message with subject "Orders Report for 2006-01-08" was received. This is the body:
Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 8bit <html> <head> <title>Orders Report</title> </head> <body> <p><table width="100%" border="1"> <tr> <!-- Start Header //--> <th width="15%">Customer</th><th width="15%">Quantity</th><th width="15%">Product</th><th width="15%">Price</th><th width="15%">Weight</th> <!-- Stop Header //--> </tr></tr> <tr> <!-- Start Totals //--> <td>Total </td> <!-- Stop Totals //--> </p> </body> </html>
Alex
#50
Posted 08 January 2006, 14:34
Quote
/*
$Id$
AutoEmailer by Jack_mcs at www.oscommerce-solution.com
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright © 2002 osCommerce
Released under the GNU General Public License
*/
$message = '
<html>
<head>
<title>Orders Report</title>
</head>
<body>
<p><table width="100%" border="1"><tr><td>Hello</td></tr></table>
</body>
</html>
';
$Subject = 'Orders Report for ' . $currentDate;
$tmessage = new Email($Recipiant, $Sender, $Subject, $CustomHeaders);
$tmessage->Cc = $Cc;
$tmessage->Bcc = $Bcc;
$tmessage->SetHtmlContent($message);
$serverFileMimeType = 'application/excel';
$tmessage->SetFileContent($pathToServerFile, $serverFileMimeType);
$tmessage->Send();
?>
Jack
Most Important: Header Tags SEO - Ultimate SEO V 2.2d
All SEO Addons: Recommended SEO Addons
Support Links:
Finding relevant link exchanges - Headers Already Sent - What does it cost? -What's my version? - How to change titles? - Preventing HotLinking
#51
Posted 08 January 2006, 16:46
yes, with the body I meant that it is what the message looks like, now the above code produces following message (subject: Orders Report for 2006-01-08):
Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 8bit <html> <head> <title>Orders Report</title> </head> <body> <p><table width="100%" border="1"><tr><td>Hello</td></tr></table> </body> </html>
BTW the Happy Birthday message looks just fine, I need to test if it's sent on a birthday now.
Alex
#52
Posted 08 January 2006, 17:13
OK, I did some more testing and it looks like the html problem might be somewhere else... maybe with my host, because when I sent that message to my web mail address, I see table with Hello. So, before I'll sort that out, I'll use my alternative address to test it further. Your code posted in #48 looks just fine, table with 5 columns and there is Total in column Customer.
My other problem could be with birthday message. I created a customer with birthday today, set up cron job on 7am and when the following is in auto_announce.php, I receive no message even if I try to call the script again from my browser:
$Recipiant = $customers['customers_email_address'];however when I replace it with
$Recipiant = 'test@customerwithbirthday.com'; //$customers['customers_email_address'];and call the script, I receive birthday message just fine. Am I doing something wrong here and overlooking obvious?
Alex
#53
Posted 08 January 2006, 21:35
culturebee, on Nov 1 2005, 09:59 PM, said:
Warning: main(../../admin/FCKeditor/fckeditor.php): failed to open stream: No such file or directory in /home/xxxxxxxxxx/public_html/admin/includes/functions/html_output.php on line 12
Warning: main(../../admin/FCKeditor/fckeditor.php): failed to open stream: No such file or directory in /home/xxxxxxxxx/public_html/admin/includes/functions/html_output.php on line 12
Fatal error: main(): Failed opening required '../../admin/FCKeditor/fckeditor.php' (include_path='.:/usr/local/lib/php') in /home/xxxxxxxxxx/public_html/admin/includes/functions/html_output.php on line 12
in my html_output i have this 'home/xxxxxxxxx/public_html/admin/FCKeditor/');
thank you
I found a easier way to fix this problem. I added it to a new install so this problem doesn't happen anymore.
When installing "require("../../FCKeditor/fckeditor.php");" in the html_output.php file some people forget to edit it. Here is the fix!
require(DIR_FS_ADMIN . '/FCKeditor/fckeditor.php');
That will fix your problems
#54
Posted 08 January 2006, 21:47
When I go to /admin/auto_emailer_announce.php from my browser It all works but
THe editor doesn't show up, and in the message box I it pulls up http://yoursite.com?
Kinda lost on how to fix. I am gonna go in myself see whats going on here. be great if someone knows the fix
#55
Posted 09 January 2006, 00:21
mr_absinthe, on Jan 8 2006, 12:13 PM, said:
$Recipiant = $customers['customers_email_address'];however when I replace it with
$Recipiant = 'test@customerwithbirthday.com'; //$customers['customers_email_address'];and call the script, I receive birthday message just fine. Am I doing something wrong here and overlooking obvious?
Alex
echo 'Customers name is '.$Recipiant."\r\n";
Jack
Edited by Jack_mcs, 09 January 2006, 00:22.
Most Important: Header Tags SEO - Ultimate SEO V 2.2d
All SEO Addons: Recommended SEO Addons
Support Links:
Finding relevant link exchanges - Headers Already Sent - What does it cost? -What's my version? - How to change titles? - Preventing HotLinking
#56
Posted 09 January 2006, 00:24
pinto192, on Jan 8 2006, 04:47 PM, said:
When I go to /admin/auto_emailer_announce.php from my browser It all works but
THe editor doesn't show up, and in the message box I it pulls up http://yoursite.com?
Kinda lost on how to fix. I am gonna go in myself see whats going on here. be great if someone knows the fix
Jack
Most Important: Header Tags SEO - Ultimate SEO V 2.2d
All SEO Addons: Recommended SEO Addons
Support Links:
Finding relevant link exchanges - Headers Already Sent - What does it cost? -What's my version? - How to change titles? - Preventing HotLinking
#57
Posted 09 January 2006, 10:21
$Recipiant = $customers['customers_email_address'];I receive no messages at all.
$Recipiant = $customers['customers_email_address']; echo 'Customers name is '.$Recipiant."\r\n";Produced "Customers name is" message on the screen and no email.
$Recipiant = 'test@customer.com'; //$customers['customers_email_address']; echo 'Customers name is '.$Recipiant."\r\n";Produced the following message on the screen: "Customer name is test@customer.com" and email was received at test@customer.com. Message "Customer name is" wasn't included in the email.
Any idea what could be done to make it work? Thanks a lot.
Alex
#58
Posted 09 January 2006, 13:41
Jack
Most Important: Header Tags SEO - Ultimate SEO V 2.2d
All SEO Addons: Recommended SEO Addons
Support Links:
Finding relevant link exchanges - Headers Already Sent - What does it cost? -What's my version? - How to change titles? - Preventing HotLinking
#59
Posted 09 January 2006, 14:57
$Recipiant = $customers['customers_email_address'];and call the script, the email is delivered to that address just fine, therefore it is getting correct information about the dob.
Alex
#60
Posted 09 January 2006, 15:47
<?php
$customers_query = mysql_query("select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, ci.customers_info_date_account_created, ci.customers_info_id from customers c, customers_info ci where c.customers_id = ci.customers_info_id") or die(mysql_error());
while ($customer = mysql_fetch_array($customers_query, MYSQL_ASSOC))
{
echo 'Customer ' . $customer['customers_firstname'] . ' ' . $customer['customers_lastname'] . ' EMail '. $customers['customers_email_address'] . "\r\n";
}
?>
Jack
Most Important: Header Tags SEO - Ultimate SEO V 2.2d
All SEO Addons: Recommended SEO Addons
Support Links:
Finding relevant link exchanges - Headers Already Sent - What does it cost? -What's my version? - How to change titles? - Preventing HotLinking














