PhotoPost Community

PhotoPost Community (http://www.photopost.com/forum/)
-   Classifieds Bug Reports (http://www.photopost.com/forum/classifieds-bug-reports/)
-   -   Multiple emails being sent (http://www.photopost.com/forum/classifieds-bug-reports/111123-multiple-emails-being-sent.html)

arenapub December 24th, 2004 07:41 AM

Multiple emails being sent
 
Still testing the system before we take it live.Last night an auction closed, and since then, the advertiser has been sent an email every ten minutes reminding them that the auction closed with no bids. Help?!?

oly51 December 24th, 2004 01:13 PM

Same Issue
 
Got the same problem. Everytime the Cron runs, I get a notification about a closed test auction I posted.

arenapub December 26th, 2004 03:52 PM

Had to Delete the Ad to stop emails
 
The only way we could stop the constant emails was to delete the ad - that stopped the notices. Not a very good solution, and we certainly can't take this system live without more testing and a fix for this problem.

Chuck S December 26th, 2004 06:41 PM

Okay an I fail to see the problem here. Your running a cron which sends an email and will send it in the frequency you specify in the cron.

Michael P December 26th, 2004 08:58 PM

No, Chuck; it shouldn't be sending them like they are describing. I'll check into it tomorrow; but it should only send the notice once.

oly51 December 26th, 2004 11:31 PM

Thanks, Michael. I've held off deleting the closed auction so we can see if the fix will work..

Michael P December 27th, 2004 11:28 AM

Okay, I checked into this and can't find the problem. In sendnotice.php at line 72 you see where I UPDATE the products table and set the status to $today (which is todays date). In the query to check for expired auctions, line 25, I explicitly ask for status codes of 0.

So, if the UPDATE is functioning correctly and the status is getting updated, then there shouldn't be multiple emails going out.

Can you check the status field in the products table for that ID # and see if the status code is being set?

arenapub December 27th, 2004 12:50 PM

Status code = 0, Emails still being sent
 
As per your suggestion, I checked the status code of an auction I am testing. The 3-day auction was posted on the 24th and ended this morning. The status code in the database table for this product (#38), shows: 0.
Yet, emails are being sent every 10 minutes to tell me that the auction received no bids, etc. I'll hold off on deleting this auction (the only way I know to stop the emails) pending further assistance!

oly51 December 27th, 2004 01:29 PM

Status is "0" for the closed auction I have on my site.

I (seller) and the high Bidder for this test auctionhave been getting emails everytime the cron runs since the auction ended.

Michael P December 27th, 2004 02:37 PM

Well, since you are getting the emails it means the script is running. But, you can also see how the query isn't taking for some reason.

Under line 72ish in sendnotice.php:

$query = "UPDATE {$Globals['pp_db_prefix']}products SET status='$today',enddate='$newend' WHERE id=$id";

add:

print $query;

and then run the sendnotice.php script in your browser to see the output.

oly51 December 27th, 2004 03:02 PM

Ran sendnotice.php. Note: The auction email is above the UPDATE pp_products SET status. There were several other email notices that I did not copy from the script. Some of them had more than 3 days to go but still were picked by the script.

Sendnotice.php output:

Email to: ***@***.com [***] about auction end 313: [***, your auction on ***.com has expired. The high bid was submitted by *** for $110.00. High bidder's profile link: http://***.com/***/member.php?u=11113 High bidder's email address: *****@***.com Auction link: http://***.com/***/showproduct.php?product=313 Thank you!]

UPDATE pp_products SET status='1104180541',enddate='1104612541' WHERE id=313checking for ads while will expire in 3 days...

Email to: ***@***.net [***] about ad 209: [***, your ad on ***.com is going to expire in 6 days. If you have not sold your product and wish to renew your ad for an additional 30 days, please click on the link below: http://***.com/***/renew.php?product...ock=1104700347 If you have sold your item, please let us know by clicking on this link: http://***.com/***/editproduct.php?sold=209 Thank you!]

Michael P December 27th, 2004 03:29 PM

> UPDATE pp_products SET status='1104180541',enddate='1104612541' WHERE id=313

Okay, so for item #313 - is the status properly set to nonzero? Is that your auction?

oly51 December 27th, 2004 04:11 PM

#313 is the test auction. It is showing up as 0 in the status table.

Here is the products table for #313: (IP and name XXX'd out)
ID: 313, User:XXX, user id:2, Cat:14, Date:1103495029, Title:Test Auction, Description:Test auction. Will run for 3 days., bigimage:02_1.jpg , views:223, Approved:1, Price:110.00, Rating:Good, watermark:no, disporder:99999, endate:1103754229, status:0, IPaddress:XX.XXX.XXX.XXX, zip code:XXXXX, adauctions:0, isauction:1, highbidder: 11113, maxbid:119.50, numbids:7, paid:0, duration:3,

Michael P December 27th, 2004 04:13 PM

So, assuming that the UPDATE query is being run - those fields should be updating. But it appears that they are not. However, you are not getting any errors. On my tests, the record is updating and only one email is being sent.

I wonder why the query is being executed, but the values are not being stored.

oly51 December 27th, 2004 06:26 PM

Michael - I did not get any more emails after I manually ran sendnotice.php. The status for the test auction changed from 0 to a date code: 1104180541.
I'll check the cron script.

Also, the manual cron sent out notices to people who had more than 3 days left on their ads.

arenapub December 27th, 2004 08:28 PM

I ran sendnotice.php in my browser and it stopped the emails. But the cure for the problem has to be found!

Michael P December 27th, 2004 08:30 PM

How are you running the cron script?

oly51 December 27th, 2004 08:30 PM

arenapub - What are you running for a cron script?

oly51 December 27th, 2004 08:43 PM

Same wavelength Michael... ;)

I was running the one you posted: */10 * * * * /usr/bin/wget --spider http://www.***.com/***/sendnotice.php

I had the cron output emailed to me. Here is the last one before the manual run:
--16:15:00-- http://www.****.com/***/sendnotice.php
=> `sendnotice.php'
Resolving www.***.com... done.
Connecting to www.***.com[***.***.***.***]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
200 OK

Michael P December 27th, 2004 08:53 PM

Try removing the --spider from the line (or change it to -q for quiet mode).

What's curious is that it appears to be getting the data to send the emails; but the one query that follows isn't updating the record.


All times are GMT -5. The time now is 07:01 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97