Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Mass email fails with deleted user

Quote Reply
Mass email fails with deleted user
Before nodding your head and saying, "So?", think about this...

You choose to send a mass emailing to All Users, pick your template, fill in anything you need to fill in, and tell the system to send.

It doesn't send; it isn't supposed to send. It is supposed to sit in a queue, waiting for you to send it. This is good; I use this to schedule mailings via cron.

Now, for the bad news. You don't send it right away; maybe it takes a few hours, or maybe a few days...

And when you send it, the emailing you have scheduled to go to 1,000 names dies after, say, 250. Fatal error.

Because you (or one of your minions) deleted user 251 from the database before the emailing actually went out. Worse, there is no way to edit the emailing to email to only those who didn't get emailed before the crash. The system knows; it tells you how many emails went out from the list. The only worthwhile solution is to create and mail the item all over again, and subject the first 250 to a duplicate emailing.

We expect to queue emailings up to 7 days in advance. We now have a policy that requires any account to be deleted to be removed from the Mail list at least 7 days before deletion, to protect against this error.

That works for us, but maybe not for you. I write this so you can be aware (especially those who develop), as I'd like to be the only one to utter choice words when a scheduled emailing dies.

Alan Frayer
Don't just read the news - make the news!
Your World News - http://yourworldnews.frayernet.com
Quote Reply
Re: [afrayer] Mass email fails with deleted user In reply to
That's a bug. Here's a patch:
Code:
--- nph-email.cgi 12 Mar 2004 01:37:32 -0000 1.42
+++ nph-email.cgi 8 Dec 2004 04:04:02 -0000
@@ -154,7 +154,12 @@
return;
}
if (!$extra or $extra eq 'Users') {
- %info = %{$DB->table('Users')->select({ Email => $email })->fetchrow_hashref};
+ if ($DB->table('Users')->count({ Email => $email })) {
+ %info = %{$DB->table('Users')->select({ Email => $email })->fetchrow_hashref};
+ }
+ else {
+ %info = ();
+ }
}
else {
%info = %{$DB->table('Links', 'Users')->select({ 'Links.ID' => $link_id })->fetchrow_hashref()};

Adrian
Quote Reply
Re: [brewt] Mass email fails with deleted user In reply to
Pardon my ignorance, but I can't afford to guess at this point...

How do I apply that patch?

Alan Frayer
Don't just read the news - make the news!
Your World News - http://yourworldnews.frayernet.com
Quote Reply
Re: [afrayer] Mass email fails with deleted user In reply to
This is the file being patched:
Code:
--- nph-email.cgi 12 Mar 2004 01:37:32 -0000 1.42
+++ nph-email.cgi 8 Dec 2004 04:04:02 -0000
The first number tells you where in the file:
Code:
@@ -154,7 +154,12 @@
3 lines of context, so you know you're editing the right place
Code:
return;
}
if (!$extra or $extra eq 'Users') {
- at the beginning of the line means remove this from the file, and + means replace it with this.
Code:
- %info = %{$DB->table('Users')->select({ Email => $email })->fetchrow_hashref};
+ if ($DB->table('Users')->count({ Email => $email })) {
+ %info = %{$DB->table('Users')->select({ Email => $email })->fetchrow_hashref};
+ }
+ else {
+ %info = ();
+ }
More context.
Code:
}
else {
%info = %{$DB->table('Links', 'Users')->select({ 'Links.ID' => $link_id })->fetchrow_hashref()};

Of course if you're on a *nix based system, you could always just copy the contents of the patch into a file and do a:
patch -i foo.patch
where foo.patch is the file. This would be done in the same location as the file you wish to patch.

Adrian
Quote Reply
Re: [brewt] Mass email fails with deleted user In reply to
Hi

Wish there was some sort of a USER Control Panel in Links SQL and the mass mailing avoided the Mailserver route and the User CP had some sort of Display to indicate the New Mass mail ... like it happens with Admin Mails In Gossamer Mail ... A Single Copy of the Message being visible to all -- here with a modification -- to those who have selected to receive the mailings. Less of a resource hog and not at all time consuming ... perhaps i could be talking of a feature request for V3.X but definitely this could be a thought for future versions.

Thanks
HyTC

Thanks
HyTC
==================================
Mail Me If Contacting Privately Is That Necessary.
==================================

Last edited by:

HyperTherm: Jan 21, 2005, 12:52 PM