Re: email address added twice in data base

 
From: "Justin J" <justin@PROTECTED>
Date: December 9th 2009

On Dec 9, 2009, at 4:59 PM, Frans Gouverne wrote:

So It should look something like:

  1. get all email addresses which have a list type "sub_confirm_list" or "unsub_confirm_list"
  2. remove this email address only if the same email address with list type "list" is present

Guess I have to add this API myself to baseSQL, or?

This script will give you a good start on something like that,

#!/usr/bin/perl
use lib ( 
 / 
/DADA/perllib );

use DADA::App::Guts;
use DADA::MailingList::Subscribers;

# For every list,
foreach my $list (DADA::App::Guts::available_lists) {

# init object
    my $lh = DADA::MailingList::Subscribers->new( { -list => $list } );

    # We're looking at these types of sublists:
    foreach my $type ( 'sub_confirm_list', 'unsub_confirm_list' ) {


        # Let's grab all the subscribers
    my $num_subs = $lh->num_subscribers( { -type => $type } );

    # Double-check the validity of this line: 
        my $subscribers = $lh->subscription_list(
            {
                -start    => 0,
                '-length' => $num_subs,
                -type     => $type,
            }
        );
        foreach my $check_sub (@$subscribers) {

            # Subscribed?
            if (
                $lh->check_for_double_email(
                    -Email => $check_sub->{email},
                    -Type  => 'list',
                )
              )
            {

                # Yes? REMOVE
                $lh->remove_subscriber(
                    {
                        -email => $check_sub->{email},
                        -type  => $type,
                    }
                );
            }
        }
    }
}

This is using the Dada Mail API You could also whip up an SQL query to do something similar, I suppose I'd be for the API, though :)

  • This mailing list is a public mailing list - anyone may join or leave, at any time.
  • This mailing list is a group discussion list (unmoderated)
  • Start a new thread, email: dadadev@dadamailproject.com

This is the developer discussion mailing list for Dada Mail.

If you are just looking for support Dada Mail, consult the message boards at:

https://forum.dadamailproject.com

Documentation for Dada Mail:

https://dadamailproject.com/d

Specifically, see the Error FAQ:

https://dadamailproject.com/d/FAQ-errors.pod.html

To post to this list, send a message to:

mailto:dadadev@dadamailproject.com

All subscribers of this list may post to the list itself.

Topics that are welcome:

  • Constructive critiques on the program (I like, "x", but, "y" needs some work - here's an idea on how to make this better...)
  • Bug/Error reports
  • Bug fixes
  • Request For Comments on any changes to the program
  • Help customizing Dada Mail for your own needs
  • Patches
  • Language Translations
  • Support Documentation/Doc editing, FAQ's, etc.
  • Discussion of any changes that you would like to be committed to the next version of Dada Mail -

Dada Mail is on Github:

https://github.com/justingit/dada-mail/

If you would like to fork, branch, send over PRs, open up issues, etc.

Privacy Policy:

This Privacy Policy is for this mailing list, and this mailing list only.

Email addresses collection through this mailing list are used explicitly to work within this email discussion list.

We only collect email addresses through our Closed-Loop Opt-In system.

We don't use your email address for any other purpose.

We won't be sharing your email address with any other entity.

Unsubscription can be done at any time. Please contact us at: justin@dadamailproject.com for any help regarding your subscription, including removal from the mailing list.

All mailing list messages sent from us will include a subscription removal link, which will allow you to remove yourself from this mailing list automatically, and permanently.

All consent to use your email address for any other purpose stated at the time of the mailing list subscription will also be revoked upon mailing list removal.