New contrib: phplist (Datatype)

Author Message

Bruce Morrison

Thursday 06 October 2005 9:01:46 pm

Hi All,

I've released a module that introduces a new datatype "PHPList Subscribe". When this datatype is added to a user class it allows for:
+ user details to be added and synchronised with PHPlist
+ subscription and unsubscription from a nominated list.
+ user is removed from PHPList when deleted from eZ publish

See: http://ez.no/community/contribs/datatypes/phplist_module

P.S. not sure that datatypes was the best category

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Xavier Dutoit

Friday 07 October 2005 8:57:03 am

Hi Bruce,

I almost posted a "I'm trying to integrate PHPlist and ez" on the phplist list yesterday !

Have you integrated phplist (the admin interface) to ez (as a module) to take care, for instance, of the authentication (phplist stores the admin passwords cleartext and I'm not a big fan of that).

Also, I was thinking about letting the user choose between one or several lists, like the preference on phplist.

Anyway, that's a great start, could you contact me on xavier [AT] sydesy [DOT] com to talk about it ?

X+

http://www.sydesy.com

Gabriel Ambuehl

Friday 07 October 2005 9:21:19 am

The way I understand it, you can add fields to the user object for each list, that would allow the user to chose the lists to subscribe to himself no?

Visit http://triligon.org

Bruce Morrison

Friday 07 October 2005 4:16:03 pm

Hi Xavier

Have you integrated phplist (the admin interface) to
 ez (as a module) to take care, for instance, of the 
authentication (phplist stores the admin passwords 
cleartext and I'm not a big fan of that).

No, this module assumes that all user interaction with phplist (apart from the recieving of the emails ;) is handled via an eZ publish user object, so there in no need for the use of passwords in phplist.

I did make a start on implmenting the PHPList user interface as a eZ module about 18 months ago but found the PHPList code a "challange" to deal with. At that time there were up to 4 releases of PHPList a month so it turned out to be more effiecent for us to simply pop the subscribe interface up in a new window.

This module is designed for community type sites where users login and can edit there own details (their own user object)

Also, I was thinking about letting the user choose 
between one or several lists, like the preference on 
phplist.

This is possible, although not directly, by adding additional "PHPList Subscribe" datatypes to the user object for the different lists.

It could be handled a bit differently. The current method simply stores a boolean for the object attribute (subscribed or not) and the list id is stored in the class attribute.

Will drop you a line.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Bruce Morrison

Friday 07 October 2005 4:17:07 pm

Hi Gabriel

Got it in one!

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Brendan Pike

Monday 14 November 2005 8:45:02 pm

Hi Bruce

Tried out this datatype today and found it a simple and clean integration solution. Well done!

Cheers
Brendan

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

Stuart Fenton

Thursday 01 December 2005 1:55:37 am

I have posted an updated version of the PHPList module that includes setting the default value. This way when the user subscibes some of the PHPLIst items can be pre-selected.

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Bruce Morrison

Thursday 01 December 2005 2:37:21 am

Hi Fats

Looking at the source it seems that you have modified the code so that when you add the datatype you can choose if the user accepts HTML mail or not (this was "off- text only" by default in the original but I've changed this to "on - text or HTML" locally).

Do you thing the "Default" term should be replaced with "Accept HTML Mail" in your changes?

Is there a reason you didn't add this to the datatype content edit (as opposed to the class edit?) where the user could make the choice?

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Stuart Fenton

Thursday 01 December 2005 2:55:46 am

I changed the code so that the admin can decide if the checkbox should be selected or not as the default state when the user subscribes.

When the user subscribes they have the choice to leave the checkbox selected or uncheck it to not join the mailing list.

If that is not what you have then I may have missed a file. I checked the code last night and it is working correctly. I have used it on this site http://www.easyvinyl.com

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Bruce Morrison

Thursday 01 December 2005 3:03:16 am

Hi Fats

OK - that makes sense. Would you mind if I incorporated these changes into the original?

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Stuart Fenton

Thursday 01 December 2005 3:12:19 am

Please go ahead. I was just helping out.

I will email all the files over to you in case I forgot any if it helps.

Send me your email address and I'll package them up for you.

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Łukasz Serwatka

Thursday 01 December 2005 3:33:53 am

It would be nice to do merge of this two almost identical contributions in to one, and make it good, maybe also put code to SVN?

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Stuart Fenton

Thursday 01 December 2005 3:43:26 am

Can you delete the phplist contribution I posted since the original has now been updated with the changes and I can't delete it.

Thanks

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Łukasz Serwatka

Thursday 01 December 2005 3:48:41 am

Yes, done.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Stuart Fenton

Thursday 01 December 2005 6:12:09 am

Feature Request
--------------

I was thinking that an appropriate extra feature would be to have the users name passed across to phplist into some custom attributes. This way the emails could be customised with their actual name rather than being informal.

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Bruce Morrison

Thursday 01 December 2005 5:28:50 pm

Hi Fats

I was thinking that an appropriate extra feature 
would be to have the users name passed across to phplist
 into some custom attributes. This way the emails could be
 customised with their actual name rather than being 
informal.

This functionallity is already partially inplace. Currently to use this you need to edit settings/phplist.ini.php and maunally add the mapping of the ezpublish attribute id to the phplist attribute id.

[AttributeMap]
MapEzPhplist[246]=1
MapEzPhplist[247]=2
MapEzPhplist[457]=3

Will map eZ Attribute ID 246 to phplist users attribute id 1 etc.

This will work for text fields and may work select or radio phplist attributes.

I'm still developing this part of the project so it is not complete or well documented.

The code is not in a public SVN repository as it is part of a number of ongoing projects. Because of this I need to keep a level of control over the code (much like eZ does with eZ publish ;)

I plan to eventually put the code up on the pubsvn server but in the meantime I'm happy to receive patches, changes or bug reports. Post them here or email me at phplist@designit.com.au

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Bruce Morrison

Thursday 01 December 2005 9:53:31 pm

Version 1.2 has been uploaded. This includes come minor bug fixes from the original as well as the enhancement provided by Fats.

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Stuart Fenton

Friday 02 December 2005 1:29:43 am

Sounds excellent. I will look forward to trying it out the attribute mapping.

I also found a way to import users into phpList and synchronise them with ez. It was a lot easier than I expected. I just exported the ezUser class to a file and imported a the file with email and the id number into PHPLIst.

When I login into ez it correctly checks the mailing lists checkbox showing that they are a member of the mailing lists. A really good implementation. It saved me going through and updating each of the users in ez.

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Bruce Morrison

Friday 02 December 2005 4:02:07 am

Good to hear Fats!

I've done a lot of work integrating eZ with external systems (mostly custom databases) and using datatypes to do this seems to be the best way. There are plently of hooks for when the object is created, deleted and modified that allow you to do whats required. Also by using datatypes you can piggyback on the content module and all the features that it provides.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Brendan Pike

Monday 05 December 2005 10:37:58 pm

Hi Bruce

I'm not sure this is really a big deal since it won't effect many people. However I have discovered that if an ezp user tries to sign-up to a list and their email already exists. (previously imported for example) it can cause some transaction errors and the like.

Cheers
Brendan

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.