Subject: The mailing list for listmasters using Sympa
List archive
- From: Steve Shipway <address@concealed>
- To: "address@concealed" <address@concealed>
- Subject: [sympa-users] Included datasource filtering
- Date: Thu, 27 Nov 2014 02:24:03 +0000
Hello everyone!
Attached is a patch for List.pm (against Sympa 6.1.23) that adds a new type of datasource – include_list_subset
This is like the existing include_list (and in fact uses most of its functions) but adds an additional test that allows you to filter the included list members according to the subscriber metadata. I.E., you can specify a regexp that is matched against a specified custom_attribute, and the subscriber is only included if their attribute value matches the regexp.
I’ve written this as it was requested by our users, some of whom currently use MailChimp. The MailChimp system provides the functionality that you can define temporary lists that have a subset of your main user list, based on various metadata tests. So, this new filtered version of include_list will allow you to make a list that people can subscribe to, giving certain custom data as they do so, and then they are possibly added to a sub-list based on tests of that data.
The filter only lets you check against one custom_attribute (though you compare with a regexp) because you cannot have multiple instances of a sub-field in the current Sympa config system.
I’ve not spent long testing this, so don’t just put it into production. I include it here for people who are interested. So far, it seems to be working as designed. Invalid regexps may break things…
Custom fields are identified by the field ID, not the label. Note that “fieldid=” will match a blank field but not a completely unset field. “Fieldid!=” will only match a set field that is not blank. You may want to add anchors to avoid false matches, IE “fieldid=^value$”
Thoughts and comments welcome.
Steve
Steve Shipway University of Auckland UNIX Systems Design Team Lead address@concealed +64 (9) 3737 599 ext 86487
|
Attachment:
sympa.filter.patch
Description: Binary data
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
- [sympa-users] Included datasource filtering, Steve Shipway, 11/27/2014
Archive powered by MHonArc 2.6.19+.