Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

AutoEmailer


197 replies to this topic

#141 Wraith622

  • Community Member
  • 34 posts
  • Real Name:Matt

Posted 03 August 2006, 22:30

Would this addon automaticaly email the store owner or an email address of choice when an order has been placed with the order info?

TIA

#142 Jack_mcs

  • Community Member
  • 24,072 posts
  • Real Name:Jack
  • Gender:Male

Posted 03 August 2006, 23:53

It could but there isn't a module for that purpose right now. Plus, that would just be duplicating the already existing code so doesn't seem to make much sense.

Jack

#143 bobsi18

  • Community Member
  • 436 posts
  • Real Name:bobsi18
  • Gender:Female
  • Location:Melbourne, Australia

Posted 14 August 2006, 13:38

Hey there ppls... I'm looking for a little advice. I've taken this great contribution and changed it a little for my needs. I'm trying to create an auto setup that emails customers who have chosen to pay via Bank deposit. If payment hasnt been received in 5 days (i.e. orders_status is still set on 'awaiting payment'), I want to send out an email saying 'please pay now..'. After 8 days, I want to send out an email saying 'order has been cancelled'. I've been modifying the auto_announce.php to try and do this. The last thing (*I think*) that I'm having trouble with is telling the module to send out if the order is XX days old. This is what I'm using...
$adjDate = sprintf("%s-%s-%s", $adjYr, substr($customer['date_purchased'], 5, 2),substr($customer['date_purchased'], 8, 2));
// Stop Date Selection
      $diff = DifferenceBetween($adjDate, $currentDate);

// Start Date Difference
      if ($diff == 5 )
// Stop Date Difference      
      {
I've introduced date_purchased in the sql query before this. The line 'if ($diff == 5 )' is where I'm having troubles.

If you need me to post more of the code to see what's going on, please let me know.

TIA
~bobsi18~
Easy Populate*Purchase Without Account*2nd Manufacturer*Product Listing in Columns*Actual Attribute Price*Add Weight to Product Attribute*New Attributes Manager*Display Cart In Header*Ship In Cart*AusPost*AusBank*Credit Class & Gift Voucher*Specials on default*Extra Fields*Header Tags*Image Magic*Points Reward*Printer Friendly Product*Simple Search Box*Specials valid from*Select specials*STS plus*Xsell*Active Countries*Credit Card by Fax/Phone*Center Shop* Online/Offline*Product in cart alert*Ultimate SEO urls*Dynamic Site map (modified)*Google Site Feed*Froogle Site feed*Updated spiders.txt*Auto mysql backup*Admin Access 22A*Fancier Invoice & Packingslip v6.1

#144 designweb

  • Community Member
  • 4 posts
  • Real Name:Adam Heaney

Posted 27 October 2006, 12:21

Hi,

Firstly, fantastic contribution. This is exactly what I was looking for.

I was wondering though if anyone has any ideas on how to change the price displayed in the automatic orders when it is emailed to me to show the gross price, tax, shipping etc. similar to that of the orders confirmation page. At the moment it only shows the price as the non-taxed price.

I have tried my best to do this but my php skills are lacking a bit. I can't figure out how to call the correct database table to retreive the information I need.

I would appreciate any help and am happy to post this as an update to the contribution when I get it right.

Thanks

Adam Heaney
Adam J. Heaney
Fsmtrading.com.au

#145 Jack_mcs

  • Community Member
  • 24,072 posts
  • Real Name:Jack
  • Gender:Male

Posted 27 October 2006, 12:33

The taxed price isn't stored in the database. The code would have to be altered to calcualte the taxed price before sending it. There is a built-in function named tep_get_tax_rate that is used for such a purpose.

Jack

#146 designweb

  • Community Member
  • 4 posts
  • Real Name:Adam Heaney

Posted 03 November 2006, 08:11

View PostJack_mcs, on Oct 27 2006, 11:33 PM, said:

The taxed price isn't stored in the database. The code would have to be altered to calcualte the taxed price before sending it. There is a built-in function named tep_get_tax_rate that is used for such a purpose.

Jack

Thanks for that however I was wondering if anyone would know how to send the final price including shipping etc.? Would that be stored in the database after the customer has purchased the product?

Thanks,

Adam Heaney
Adam J. Heaney
Fsmtrading.com.au

#147 Jack_mcs

  • Community Member
  • 24,072 posts
  • Real Name:Jack
  • Gender:Male

Posted 03 November 2006, 13:37

Yes, it is stored in the orders total table.

Jack

#148 designweb

  • Community Member
  • 4 posts
  • Real Name:Adam Heaney

Posted 04 November 2006, 03:42

View PostJack_mcs, on Nov 4 2006, 12:37 AM, said:

Yes, it is stored in the orders total table.

Jack


Thanks Jack,

Much appreciated and very helpful. I have now got the final price etc.

I am having issues separating the class with ot_tax, ot_shipping etc. into separate columns for the html output.

at the moment I have class='ot_total' I tried using the where class <> 'ot_tax' and class <> 'ot_shipping but it comes out in the html as a separate row which means the totals add up incorrectly. any ideas to have them in columns like the rest??

Thanks

Adam Heaney
Adam J. Heaney
Fsmtrading.com.au

#149 Jack_mcs

  • Community Member
  • 24,072 posts
  • Real Name:Jack
  • Gender:Male

Posted 04 November 2006, 04:09

What about class like 'ot_total'?

Jack

#150 mr_absinthe

  • Community Member
  • 368 posts
  • Real Name:Alex
  • Location:London, UK

Posted 08 February 2008, 08:27

It was working fine until recently but now the script is not being executed and I'm receiving the following error message:

PHP Warning:  Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name]().  If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/class.Email.php on line 261
PHP Warning:  Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name]().  If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/class.Email.php on line 265
PHP Warning:  Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name]().  If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/class.Email.php on line 270
PHP Warning:  Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name]().  If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/class.Email.php on line 281
PHP Warning:  Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name]().  If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/class.Email.php on line 292
PHP Warning:  Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name]().  If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/class.Email.php on line 297
PHP Warning:  Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name]().  If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/class.Email.php on line 304
PHP Warning:  include(): Unable to access ../../includes/configure.php in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/auto_emailer.php on line 13
PHP Warning:  include(../../includes/configure.php): failed to open stream: No such file or directory in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/auto_emailer.php on line 13
PHP Warning:  include(): Unable to access ../../includes/configure.php in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/auto_emailer.php on line 13
PHP Warning:  include(../../includes/configure.php): failed to open stream: No such file or directory in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/auto_emailer.php on line 13
PHP Warning:  include(): Failed opening '../../includes/configure.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/auto_emailer.php on line 13
PHP Notice:  Use of undefined constant DB_SERVER - assumed 'DB_SERVER' in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/auto_emailer.php on line 15
PHP Notice:  Use of undefined constant DB_SERVER_USERNAME - assumed 'DB_SERVER_USERNAME' in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/auto_emailer.php on line 15
PHP Notice:  Use of undefined constant DB_SERVER_PASSWORD - assumed 'DB_SERVER_PASSWORD' in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/auto_emailer.php on line 15
PHP Warning:  mysql_connect(): Unknown MySQL server host 'DB_SERVER' (1) in /var/www/vhosts/mysite.com/httpdocs/admin/auto_emailer/auto_emailer.php on line 15
Unable to connect to database.

Any ideas?
Absinthe Original Liquor Store

#151 Jack_mcs

  • Community Member
  • 24,072 posts
  • Real Name:Jack
  • Gender:Male

Posted 08 February 2008, 13:06

It looks like your host made a change in its php version. The code casuing that problem needs to be rewritten to get rid of the error but you can do so, as the text says

Quote

If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file

Jack

#152 Eighteen48

  • Community Member
  • 170 posts
  • Real Name:Ano Hito

Posted 21 April 2008, 01:47

Is there a way to make this work with TinyMCE instead of FCK Editor?
Powered By osC 2.2RC2a STS 4.5.8 - HTC 2.6.3 - FP 1.5.9 - BCH 1.0.0

#153 mr_absinthe

  • Community Member
  • 368 posts
  • Real Name:Alex
  • Location:London, UK

Posted 09 May 2008, 09:48

Jack,

when the birthday email is sent to a customer, the sender's (From:) address is sometimes multiplied by 25 approximately. It looks like:

From: info@mysite.com, info@mysite.com,info@mysite.com,info@mysite.com,info@mysite.com,info@mysite.com,

Any idea what might be causing it?
Absinthe Original Liquor Store

#154 Jack_mcs

  • Community Member
  • 24,072 posts
  • Real Name:Jack
  • Gender:Male

Posted 09 May 2008, 12:45

View PostEighteen48, on Apr 20 2008, 09:47 PM, said:

Is there a way to make this work with TinyMCE instead of FCK Editor?
Yes, in fact I prefer TinyMCE but it wasn't a ready when this contribution came out. To use it, you would need to convert the tep_draw_fckeditor calls to standard oscommerce ones and include the TinyMCE code in the <head> section as described in that contribution.

Jack

#155 Jack_mcs

  • Community Member
  • 24,072 posts
  • Real Name:Jack
  • Gender:Male

Posted 09 May 2008, 12:49

View Postmr_absinthe, on May 9 2008, 05:48 AM, said:

Jack,

when the birthday email is sent to a customer, the sender's (From:) address is sometimes multiplied by 25 approximately. It looks like:

From: info@mysite.com, info@mysite.com,info@mysite.com,info@mysite.com,info@mysite.com,info@mysite.com,

Any idea what might be causing it?
I haven't seen this problem and can't see how it can happen with the code the way it is. Does it happen for any customer? If not, then maybe there are some duplicate emails in the database. It seems unliklely but that's all I can think of at the moment.

Jack

#156 mr_absinthe

  • Community Member
  • 368 posts
  • Real Name:Alex
  • Location:London, UK

Posted 12 May 2008, 20:25

It only happens to some customers. When tested, I received birthday email to my gmail just fine but replies from some customers look like this:

Original Message -----
From: info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com; info@mysite.com
To: markXXXX@comcast.net
Sent: Tuesday, May 08, 2007 8:01 AM
Subject: Your Birthday Gift from My Site
As you can see, there is 19 From: email addresses (I just replaced it with mysite obviously). Unfortunately (or fortunately) I do not receive that many replies to those birthday emails. Sometimes it's all fine, but sometimes there was minimum six and maximum 25 copies of the address. Could the number be related to the number of emails sent that day? Very weird... and little bit annoying. What could be causing it? The code that sends it is this, correct?:

$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());

  $adjYr =  substr($currentDate, 0, 4);
  $adjMth = (int)substr($currentDate, 5, 2);
  $adjMth = str_pad($adjMth, 2, "0", STR_PAD_LEFT);

  while ($customer = mysql_fetch_array($customers_query, MYSQL_ASSOC))
  {
// Start Date Selection
	  $adjDate = sprintf("%s-%s-%s", $adjYr, substr($customer['customers_dob'], 5, 2),substr($customer['customers_dob'], 8, 2));
// Stop Date Selection
	  $diff = DifferenceBetween($currentDate, $adjDate);
// Start Date Difference
	  if ($diff >= 0 && $diff < 1)
// Stop Date Difference
	  {
// Start Subject
		   $Subject = 'Your Birthday Gift from My Site';
// Stop Subject		 
		 $Recipiant = $customer['customers_email_address'];
		 $tmessage = new Email($Recipiant, $Sender, $Subject, $CustomHeaders);
		 $tmessage->Cc = $Cc;
		 $tmessage->Bcc = $Bcc;

		 $message = '
		 <html>
		  <head>
		   <title>Happy birthday</title>
		  </head>
		  <body>
		  <p>Dear ' . $customer['customers_firstname'] . ',<br><br>
 
<!-- start message //-->  
<u>test</u> your   <strong>message</strong> here<br />	 now
<!-- stop message //-->

		 </body>
		 </html>
		 ';

// Mail it
		 $tmessage->SetHtmlContent($message);
		 $serverFileMimeType = 'text/html';
		 $tmessage->SetFileContent($pathToServerFile, $serverFileMimeType);
//		 $tmessage->Send();
// changed to \n instead of \r\n below - otherwise no html - mr_absinthe
		 $headers .= 'MIME-Version: 1.0' . "\n";
		 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
		 $headers .= 'From: info@mysite.com' . "\n";
		  mail($Recipiant, $Subject, $message, $headers);		 
	  }
  }
?>

Absinthe Original Liquor Store

#157 Jack_mcs

  • Community Member
  • 24,072 posts
  • Real Name:Jack
  • Gender:Male

Posted 12 May 2008, 22:42

Yes, that is the code. It is reading all of the customers information and then checks the date (that really should be in the sql command). If it falls within that date, it sends an email to that one address. So I don't see how it can be adding more than one address per customer.

Jack

#158 binkycrafts

  • Community Member
  • 39 posts
  • Real Name:Tony Charlton

Posted 12 July 2008, 14:59

Hi, Great contrib, I found because today is my birthday and I received an email from a forum I am a member of and thought about adding this type of thing to our online store and found this. I can get the emails to work perfectly when running from the browser but cron throws me the following error email (The path up to admin has been removed) . . .

/admin/auto_emailer/auto_emailer.php: line 1: ?php: No such file or directory
/admin/auto_emailer/auto_emailer.php: line 2: /aquota.user: Permission denied
/admin/auto_emailer/auto_emailer.php: line 3: $: command not found
/admin/auto_emailer/auto_emailer.php: line 4: AutoEmailer: command not found
/admin/auto_emailer/auto_emailer.php: line 5: osCommerce,: command not found
/admin/auto_emailer/auto_emailer.php: line 6: http://www.oscommerce.com: No such file or directory
/admin/auto_emailer/auto_emailer.php: line 8: syntax error near unexpected token `c'
/admin/auto_emailer/auto_emailer.php: line 8: ` Copyright © 2002 osCommerce'

it is obviously reading the file but something is causing it to not run it as it should, any ideas what I need to do to my set up to make it work??

actual code from /admin/auto_emailer/auto_emailer.php is as follows:
<?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
*/
  include('class.Email.php');
  include('../includes/configure.php');
 
  $link = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD) or die("Could not connect");
  mysql_select_db(DB_DATABASE);
  
  //Set some common items
  $Sender = 'binky@binkycrafts.com';
  $Recipiant = 'test@binkycrafts.com';
  $Cc = '';
  $Bcc = '';
  $currentDate = date('Y-m-d'); //or enter a date in the form of yyyy-mm-dd

  include('date_functions.php');

// Start modules 
include('auto_newproducts.php');
// Stop modules

  mysql_close($link);
?>

Tony

#159 binkycrafts

  • Community Member
  • 39 posts
  • Real Name:Tony Charlton

Posted 12 July 2008, 15:04

Just adding another reply because I did not enable email notifications and could not work out how to turn them on once I had posted - is there any hope ???
Tony.
Tony

#160 binkycrafts

  • Community Member
  • 39 posts
  • Real Name:Tony Charlton

Posted 12 July 2008, 15:14

another quick question . . I want to add a greeting in the "birthday" email using the customers first name but am not sure how to code this into the $message?

I tried adding this:
$firstname = $customer['customers_firstname'];

before the $message = '.... and then after:
<!-- start message //-->

I had:
<p>Hi <?php echo $firstname ?>,</p>

as my opening line but this only sends "Hi ," in the email

Hope someone can spot the rookie mistake :-D

Thanks,
Tony.
Tony