Forum OpenACS Development: Re: BehaveLikeOutlookP

Collapse
3: Re: BehaveLikeOutlookP (response to 1)
Posted by Carl Robert Blesius on
I noticed Malte added this code to acs-mail-lite after posting:

# The CC E-Mail is unknown in the system. Create the person.
if {[string eq "" $party_id]} {
if {[regexp {(.+)[\.|_](.+)@(.+)} $email_addr match first_names last_name url]} {
set name "$first_names $last_name"
} else {
set name $email_addr
set first_names "."
set last_name [lindex [split $email_addr "@"] 0]
}
if {$contacts_p} {
set party_id [contacts::person::new -email $email_addr -first_names $first_names -last_name $last_name]
ns_log Notice "Contact generated for $first_names $last_name at $email_addr"
} else {
set party_id [person::new -email $email_addr -first_names $first_names -last_name $last_name]
ns_log Notice "Person generated for $first_names $last_name at $email_addr"
}
}

Now we have contacts specific code in an essential package.
Can someone fill me in on the best way to prevent Malte's contacts code from creeping into acs-mail-lite?

Carl

P.S. Malte, why are you adding strangly named people to the system using person::new? Will this effect future registrations if someone has been "added" earlier through inclusion in an email exchange within the contacts package?

Collapse
4: Re: Re: BehaveLikeOutlookP (response to 3)
Posted by Malte Sussdorff on
Carl, wrong commit from testing, so don't worry, removed. As for your direct question:

A) Indeed person::new only makes sense if we use contacts in conjunction with mail-tracking.

B) Not an issue. Code has been written to take this into account (aka: e-mail address already exists in the system as a person but not as a user). But it is not committed as I just overwrote the registration process through a custom package. And this is an issue you face with *every* contacts installation, not only if there are arbitrary e-mails in the system. So we might want to start a new thread and discuss the best behaviour there.

Collapse
Posted by Carl Robert Blesius on
A) Giving end users the option of arbitrarily adding others to the database might make sense in applications that you are building for specific business clients, but I am having trouble fitting it into how I want to run my sites/applications so I am very happy to see you remove this code from core because there is a danger others will use it as an example. It is also a relief to hear it was test code, b/c it helps me rationalize why you were falling back on naming people using punctuation if no accurate data is available.

B) Happy to contribute to the discussion but I doubt I will be using contacts for any sites I run. It seems it has become a very "customer relationship management" specific package based on the demos you have given me and the discussion I have had with people about it.