vendredi 8 avril 2011

Newsletter Plugin for Liferay


Our company (Asten) has developed a Newsletter plugin based upon 2 portlets :
1 : Newsletter, only visible for the webmaster.
This portlet is configured (preferences dialog) with :
- an rss feed, coming from an asset publisher.
- the id of a web content display portlet. It will gives the "editorial" of the newsletter.
- the url of the unsubscribe portlet, for the creation of the unsubscribe link.
- a key for crypting
- The name of the usergroup containing the subscriber list
The HTML of the newsletter is made by parsing the rss xml feed, and via content api we extract the abstract of the articles. On the beginning of the mail we add the content of the chooses Editorial article.
We then loop on the usergroup, and send an email at each, including a specific link for the unsubscription, with a crypted parameter containing the emailaddress of the subscriber.

The email sending run on separate thread.
We store the newsletter in the annonucment portlet, but it has limitation : 4000 characters.
Instead, we plan to store the newsletter as a document in the DocumentLibrary

2 : Subscribe/unsubscribe, visible for the guests.
This portlet is configured with :
- a key for un-crypting (the same as the one in the Newsletter portlet)
- The name of the usergroup containing the subscriber list (the same as the one in the Newsletter portlet)
When a user subscribe, he gives his emailaddress and we create an user account (without password) and attach him to the configured newsletter user group.
He unsubscribes from an "in mail" url, calling back this portlet, with his emailadresse as crypted parameter. The user is then deleted.

That works well and cand be extended.

I can't give you the code, but you have here the key principes.

Aucun commentaire:

Enregistrer un commentaire