Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Newsletter vs. deleted users

Asked Modified Viewed 3,619 times
S
shearer
S
  • Member, joined since
  • Contributed 199 posts on the community forums.
  • Started 45 threads in the forums
  • Started this discussions
asked
Member

Hi

when i send out newsletters, i get 5 copy's myself. i thinks it is becores i have deleted some useres that wass register to recive newsletters.

now i will like to run a check to see if any of my deleted users (user_id) still is in the newsletter_subs tabel.

anyone that can help me with a code i can run, to check for this. so i can delete them manual.
0 replies

19 posts

S
Super
S
Super 10
~Samchammy

Find some games below!!!
Gamedna.tk
  • Senior Member, joined since
  • Contributed 248 posts on the community forums.
  • Started 32 threads in the forums
answered
Senior Member

Depending on the number of users submitted, you can just defuse it and re-infuse it. That will delete anybody submitted to your names.
0 replies
S
shearer
S
  • Member, joined since
  • Contributed 199 posts on the community forums.
  • Started 45 threads in the forums
  • Started this discussions
answered
Member

Yes. butt that dosent help me, in this problem.
0 replies
— 1 month later —
K
kemper
K
kemper 10
farm4.static.flickr.com/3057/2609887104_4470d79b05.jpg
  • Senior Member, joined since
  • Contributed 235 posts on the community forums.
  • Started 8 threads in the forums
answered
Senior Member

Simple solution... Delete the 5 emails from your inbox. Tada!

I had the same issue, but not worth the time invested on resolving.
Edited by kemper on 08-05-2008 02:50,
0 replies
S
shearer
S
  • Member, joined since
  • Contributed 199 posts on the community forums.
  • Started 45 threads in the forums
  • Started this discussions
answered
Member

Yes butt now i got about 8.
0 replies
G
grr
G
grr 10
  • Junior Member, joined since
  • Contributed 24 posts on the community forums.
  • Started 7 threads in the forums
answered
Junior Member

Wrong but.
0 replies
K
kemper
K
kemper 10
farm4.static.flickr.com/3057/2609887104_4470d79b05.jpg
  • Senior Member, joined since
  • Contributed 235 posts on the community forums.
  • Started 8 threads in the forums
answered
Senior Member

Not sure what

Quote

grr wrote:
Wrong but.

means, but delete 8 emails.
0 replies
H
Homdax
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,247 posts on the community forums.
  • Started 108 threads in the forums
answered
Fusioneer

Search for their e-mails in the database. Delete those emails.
SQL+PHP for this would of course be easier, but coding that is not my cup of tea.

Kemper and grr: thanks for not answering original question.
Edited by Homdax on 14-05-2008 10:56,
0 replies
K
kemper
K
kemper 10
farm4.static.flickr.com/3057/2609887104_4470d79b05.jpg
  • Senior Member, joined since
  • Contributed 235 posts on the community forums.
  • Started 8 threads in the forums
answered
Senior Member

No Problem!
0 replies
S
shearer
S
  • Member, joined since
  • Contributed 199 posts on the community forums.
  • Started 45 threads in the forums
  • Started this discussions
answered
Member

i cant see what email, that i get it return from.
0 replies
H
Homdax
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,247 posts on the community forums.
  • Started 108 threads in the forums
answered
Fusioneer

You most definitively should. In Your e-mail software make sure you can see "all headers". There is a return-path. Its standard for all mail-servers.
0 replies
G
GreenMoo
G
  • Junior Member, joined since
  • Contributed 20 posts on the community forums.
answered
Junior Member

Try this:
Back up your database first! Or face death!

Then open up a Custom Page, Give it a title, and copy and paste this code:
<?php

$result = dbquery("SELECT * FROM ".$db_prefix."newsletter_subs");
$remove_count = 0;

while ($a = dbarray($result))
{
$entry_id = $a['newsletter_sub_user'];
$checkresult = dbquery("SELECT user_name FROM ".$db_prefix."users WHERE user_id=".$entry_id);
$checkrows = dbrows($checkresult);
if ($checkrows == 0)
{
dbquery("DELETE FROM ".$db_prefix."newsletter_subs WHERE newsletter_sub_user=".$entry_id);
$remove_count++;
}
}

echo "<br><center><b>Removed ".$remove_count." undead users from the database.</b></center><br>";

?>


And click "Preview Page". Don't save that page! It might take a while to run the script, I don't know. Depends on your database. Once you've done it, check under the newsletter subscription management that everyone that should be subscribed still is. I hope this works - and be sure to backup!
0 replies
H
Homdax
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,247 posts on the community forums.
  • Started 108 threads in the forums
answered
Fusioneer

Hmm...the only one allowed the make capital penalizing threats around here is me...but hope it works. B)
0 replies
S
shearer
S
  • Member, joined since
  • Contributed 199 posts on the community forums.
  • Started 45 threads in the forums
  • Started this discussions
answered
Member

Hi

i have tryet this now. but it dosent work. i still got all the emails.
0 replies
G
GreenMoo
G
  • Junior Member, joined since
  • Contributed 20 posts on the community forums.
answered
Junior Member

How many people do you have signed up to your newsletter? About 800?

Looking again at the bit of newsletter_admin.php that sends the emails, I can see this:

$result = dbquery(
"SELECT tns.*, tu.user_id,user_name,user_email FROM ".$db_prefix."newsletter_subs tns
LEFT JOIN ".$db_prefix."users tu ON tns.newsletter_sub_user=tu.user_id"
);
if (dbrows($result)) {
$i = 1; $rows = dbrows($result); $bcc_list = "";
while ($data = dbarray($result)) {
$bcc_list .= ($i != 1 ? ", " : "").$data['user_email'];
if ($rows == 1 || $i == 99) {
if (!sendemail($settings['siteusername'],$settings['siteemail'],$settings['siteusername'],$settings['siteemail'],$subject,$content,$_POST['format'],"", $bcc_list)) {
$error = $locale['nl418'];
}
$bcc_list = "";
}
if ($i != 99) { $i++; } else { $i = 1; }
$rows--;
}
} else {
$error = $locale['nl419'];
}


As far as I am understanding, that selects all newsletter subscriptions and tries to pair a user with them. But if it can't, then it will just chuck a Null in the user details bit and carry on.

The bit from while to the end is clumping together a list of 99 email addresses - it loops through all the emails it gets and if it's the last row or the 99th email, it will send that clump. Otherwise it will glue the email onto the end - so I was wrong, and it's not really the deleted users that are causing the problem as the empty email will be just glued onto the end of that "clump" and ignored by your Mail Program.

Now, to send each clump, this line is used:
sendemail($settings['siteusername'],$settings['siteemail'],$settings['siteusername'],$settings['siteemail'],$subject,$content,$_POST['format'],"", $bcc_list)


That's saying:
Send an email to the Site Owner
From the Site Owner
With this $subject and this $content and this HTML option
and Blind Carbon Copy it to this Clump of Email addresses in $bcc_list


So for every 99 emails clumped together and sent, it's sending one to you and distributing the rest via Bcc.

Therefore, it's a developer problem/bug? Am I right? Or something you have to put up with for an immensely popular emailing list (that's quite a lot of emails!)
Edited by GreenMoo on 22-05-2008 19:47,
0 replies
S
shearer
S
  • Member, joined since
  • Contributed 199 posts on the community forums.
  • Started 45 threads in the forums
  • Started this discussions
answered
Member

Correct. right now i have 730 members signed up.

so this i something that digi maybe need to fix. in a new release or what ?

or can i in newsletter_admin.php juste change the org linies.

if ($rows == 1 || $i == 99) {
if (!sendemail($settings['siteusername'],$settings['siteemail'],$settings['siteusername'],$settings['siteemail'],$subject,$content,$_POST['format'],"", $bcc_list)) {
$error = $locale['nl418'];
}
$bcc_list = "";
}
if ($i != 99) { $i++; } else { $i = 1; }
$rows--;
}


with something like this ?, or can this be stop as spamm ?

if ($rows == 1 || $i == 800) {
if (!sendemail($settings['siteusername'],$settings['siteemail'],$settings['siteusername'],$settings['siteemail'],$subject,$content,$_POST['format'],"", $bcc_list)) {
$error = $locale['nl418'];
}
$bcc_list = "";
}
if ($i != 800) { $i++; } else { $i = 1; }
$rows--;
}
Edited by shearer on 22-05-2008 21:37,
0 replies
G
GreenMoo
G
  • Junior Member, joined since
  • Contributed 20 posts on the community forums.
answered
Junior Member

I'm not sure of the reason in which 99 emails were chosen to clump together. In the end, I presume, it's to speed up mass mailing by avoiding calling sendmail 730 times and only doing it 7 times instead. Too many in one clump might overload your email server, too little and the script would take ages.

Maybe, what we could try, is not sending it to the site owner every time.

$result = dbquery(
"SELECT tns.*, tu.user_id,user_name,user_email FROM ".$db_prefix."newsletter_subs tns
LEFT JOIN ".$db_prefix."users tu ON tns.newsletter_sub_user=tu.user_id"
);
if (dbrows($result)) {
$i = 1; $rows = dbrows($result); $bcc_list = "";
$primary_email = $settings['siteemail'];
$primary_to_name = $settings['siteusername'];
while ($data = dbarray($result)) {
if ($primary_email == "")
{
$primary_email = $data['user_email'];
$primary_to_name = $data['user_email'];
}
else
{
$bcc_list .= ($i != 1 ? ", " : "").$data['user_email'];
}
if ($rows == 1 || $i == 99) {
if (!sendemail($primary_to_name,$primary_email,$settings['siteusername'],$settings['siteemail'],$subject,$content,$_POST['format'],"", $bcc_list)) {
$error = $locale['nl418'];
}
$bcc_list = "";
$primary_to_name = "";
$primary_email = "";
}
if ($i != 99) { $i++; } else { $i = 1; }
$rows--;
}
} else {
$error = $locale['nl419'];
}


I have no idea if that will work - or what effects it will have, or if it will reveal all the other users emails to a select few. In order to test this I'd need alot of emails that can be inspected by me... so I highly recommend you don't use this and instead let Digitanium have a look over it first.
0 replies
S
shearer
S
  • Member, joined since
  • Contributed 199 posts on the community forums.
  • Started 45 threads in the forums
  • Started this discussions
answered
Member

yep. i will wait and see if digi look in this thread. becores i cant send him a PM becores of a full indbox.
0 replies
I
it-norden
I
Find it.
Think...
Fix it!
  • Senior Member, joined since
  • Contributed 240 posts on the community forums.
  • Started 7 threads in the forums
answered
Senior Member

use mantis to report bugs.. dont prest digi ;) he is busy.. try sonme on else from crew please ;)
0 replies
S
shearer
S
  • Member, joined since
  • Contributed 199 posts on the community forums.
  • Started 45 threads in the forums
  • Started this discussions
answered
Member

okay. i didnt know that mantis was for infusions to. i'll do that.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 19 posts
  • Votes 0 votes
  • Topic users 7 members

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet