Hi Samer,
The clone-a-list code is something I have been looking for Can you provide instructions on how to create the API and where this code is put? Thanks
CarlK
----- Original Message ----- From: "Samer Bechara" farrooda@gmail com To: "[list_settings list_name] Subscriber" ckuczun@PROTECTED Sent: Monday, May 04, 2009 12:31 PM Subject: [dadadev] Re: Creating a new list via API does not generate all values
I have attached the whole code to clone a list via API, it should be useful for someone Comments are inside
--Samer
Justin J wrote: >
>
I am trying to create a new list via the Dadamail API I am using the DADA::MailingList Create method
However, when I create the list, only 4 fields are being inserted into the database (list, admin_menu, cipher_key, fallback_field_values) I checked the LIST_SETUP_DEFAULTS variable, and it contains all the elements However, for some reason, these aren't being loaded into the database (MySQL backend) Why is this occurring?
I know you've solved your problem using a different method, but would you mind posting the code you were trying to get working when using, DADA::MailingList::Create?
--
Post: dadadev@PROTECTED
Unsubscribe: http://dadamailproject com/cgi-bin/dada/mail cgi/u/dadadev/
List Information: http://dadamailproject com/cgi-bin/dada/mail cgi/list/dadadev
Archive: http://dadamailproject com/cgi-bin/dada/mail cgi/archive/dadadev
Mailing List Powered by Dada Mail http://dadamailproject com/cgi-bin/dada/mail cgi/what_is_dada_mail/
!/usr/bin/perl
use strict;
This program adds a new mailing list to dadamail via API, it takes the
following arguments:
1) The name of the list to be created
2) The password of the list
3) The email address of the list owner, e g address emails are being
sent from
use lib '/var/www/cgi-bin/smartdev/list';
use DADA::MailingList; use DADA::MailingList::Settings; use DADA::Security::Password;
Create List - Returns a DADA::MailingList::Settings object
Here is where I was getting the error, only 4 fields were
being added: list, admin_menu, cipher_key, fallback_field_values
my $ls = DADA::MailingList::Create({ list => $ARGV[$0] });
Get values from template list
my $templatels = DADA::MailingList::Settings->new( { -list => 'SmartWeb', # SmartWeb is the name of the template list } ); my $params = $templatels->get;
Apply all settings of the template mailing list to the list just created
while ( my ($key, $value) = each(%$params) ) {
Skip the list param which is unchangeable
if($key eq "list"){ next; }
$ls->param($key, $value); }
Generate the password from second argument
my $enc_pass = encrypt_passwd($ARGV);
# Save a setting $ls->save( { list_name => "John Brennan Hair - " $ARGV,
info => $params->{info} ", " $ARGV " branch", password => $enc_pass, list_owner_email => $ARGV, privacy_policy => $params->{privacy_policy}, physical_address => "John Brennan Hair, " $ARGV ", Australia", } );
exit 0;
--
Post: dadadev@PROTECTED
Unsubscribe: http://dadamailproject com/cgi-bin/dada/mail cgi/u/dadadev/
List Information: http://dadamailproject com/cgi-bin/dada/mail cgi/list/dadadev
Archive: http://dadamailproject com/cgi-bin/dada/mail cgi/archive/dadadev
Mailing List Powered by Dada Mail http://dadamailproject com/cgi-bin/dada/mail cgi/what_is_dada_mail/
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:
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:
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.
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.