Fwd: Extending Subscriber Field Tags

 
From: "Justin J" <justin@PROTECTED>
In-Reply-To: (no subject)
Date: April 16th 2009

From: Samer Bechara This is my first post on this mailing list, and hopefully it won't
be the last :) (make sure to post to: dadadev@dadamailproject com !) :)

1) How should I add the subscribers to the db, is it enough to
populate the dada_subscribers table, or is there anything else that
needs to be done? I am using the MySQL back end

It usually easy enough to just add it through the list control panel -
is this not working?

You can also add it via SQL, something like:

ALTER TABLE dada_subscribers  ADD COLUMN your_new_field TEXT

will do the trick (in 3 0 x)

2) When sending an email, the partial sending options are only
limited to "where" and "like" This is understandable as all the
subscriber field tags are being added as text However, I sometimes
need to email all subscribers who have a total transactions number
bigger than X, or whose birthday is during the next week In this
case, the text field isn't enough, we need a date and an integer
field for subscriber tags

I agree, it's limiting

I am willing to add this functionality to dadamail, however I need
some guidance What files are responsible for this functionality,
what documentation should I read, etc

It's a very large job ahead of you The 3 0 3 and 3 1 versions of Dada
Mail are extremely different in how they work with subscriber fields
I'd probably encourage you to fork off either of those versions in git:

3 0 3 http://github com/justingit/dada-mail-3 0 x/tree/master

3 1 http://github com/justingit/dada-mail/tree/feature-subscriber_editable_fields

The 3 1 version is in major flux and it would be very hard to fold
your changes into whatever becomes more stable The 3 0 3 is in no
flux, so it would be much easier to make your changes there, and then
use those changes as a proof of concept for 3 1

In 3 0 3, the places you'll want to look closely is the,
"create_mass_sending_file" method in
Dada::MailingList::Subscribers::baseSQL You should see lines that look
like this:

     if(keys %{$args{-partial_sending}}) {

             foreach (keys %{ $args{-partial_sending} }){
                 if($args{-partial_sending}->{$_}->{equal_to}){

                     $query 
= ' AND ' 
 $_ 
 ' = \'' 
 $args{- 

partial_sending}->{$}->{equalto} '\''; #carp 'QUERY: ' $query;

                 }
                 elsif($args{-partial_sending}->{$_}->{like}){

                     $query 
= ' AND ' 
 $_ 
 ' LIKE \'%' 
 $args{- 

partial_sending}->{$_}->{like} '%\'';

                 }
             }

         }

Which will need editing - but you can see how the query is built up -
very easy

There's a few calls to this subroutine and sadly, there's also code
around the program, especially in DADA::App::MassSend that massages
the paramaters passed to Dada Mail to work well with the
"create_mass_sending_file method", as well as the
"fancy_print_out_list" method in
DADA::MailingList::Subscribers::baseSQL Look in the
previewMessageReceivers() subroutine in the mail cgi file to see how
that's called

It's a pretty dragon-filled part of Dada Mail, sadly and something I'm
currently cleaning up a bit in 3 1, but it's still very scary, as I'm
not done with my cleanup

But please, by all means give it a shot! :)

  • 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.