« Back

Announcements and Alerts

Company Blogs April 14, 2008 By Ray Augé Staff

In Liferay 5.0.0+ we have added a new feature: Announcements/Alerts.

Announcements/Alerts are two portlets which can be used to broadcast some message to a list of users within a known scope. Essentially they provide a mass messaging engine you'd tend to think of as a "news letter" or one-way messaging.


They provide the following features:

  1. Configurable, unlimited number of Announcement Types through portal.properties (add locatized type names via Liferay's resource bundle extension mechanism).
  2. Delivery to known scopes, called Delivery Scope, including:
    1. Individual User (API only)
    2. Role
    3. User Group
    4. Community
    5. Organization
  3. Delivery Mechanisms include Email, SMS, and Website. (Website delivery is acheived simply by adding the portlet to any page accessible to the user. The content of the portlet is allways sensitive to the viewing user.)
  4. Scheduled delivery. Each entry has a Display and Expiration Date. The entry won't be delivered until Display Date is <= now. Expiration Date is used primarily for the "Website" delivery mechanism.
  5. Read Tracking. Website delivery tracks timestamped read status per user, per entry.
  6. Subscription Control per user, per Announcement Type. A user determines which Delivery Mechanism to use for each individual Announcement Type. See the My Account page.
  7. Broadcast Control of announcements. Broadcasting Announcements is not a permission which should be granted lightly. As such, a user must first be granted Add Entry permission on the portlet to access the Announcement management functions. Secondly, a user must have Assign Member permission on a given scope in order to be able to broadcast an Announcement/Alert to that scope.

i.e. a Community Owner is not, by default, granted permission to broadcast Announcements or Alerts to their own Community. The Portal Admin must first has to grant them Add Entry permission on the portlet. Only then would they have all the permissions required (they would already have Assign Member as a function of being the owner) to broacast to their own Community. This is to prevent abuse of portal resources and prevent needless spamming of portal users.

Via the service API we now have a means of enabling event based messaging to individual users (or any delivery scope) without having to explicitly write new delivery services or functions.

There are still a few features that I'd like to see added to this portlet, but I think we now have a good base to build on.

Threaded Replies Author Date
Thanks for the new feature list. I can see this... Eric Brennan April 14, 2008 12:06 PM
You can take a look at the Road Map... Ray Augé April 14, 2008 12:27 PM
great feature! When will you release Liferay... Christian Steiger April 14, 2008 3:00 PM
Very Nice! Have you planed to improve this... Michel Gelinas May 7, 2008 7:21 AM
Yes, It's on my todo list. :) Ray Augé May 7, 2008 7:36 PM
Hi, Ray What are differences between... andrei harhots May 29, 2008 8:58 AM
The idea is that "Alerts" is hidden by default.... Ray Augé May 29, 2008 9:17 AM
Appreciate your helpful answer, Ray! andrei harhots May 30, 2008 12:05 AM
A great function indeed! Is the... Peter Hovens June 30, 2008 3:11 PM
Hi Ray, I like the feature, but when there are... Mike Cunneen August 1, 2008 9:11 PM
Can I configure this portlet like the... Allen Chiang August 13, 2008 10:39 AM
The remote service (including javascript) is... Ray Augé August 13, 2008 2:32 PM
Hi Ray, That's great! Thanks! So the portlet... Allen Chiang August 14, 2008 9:36 AM
If I understand correctly, you just want to use... Ray Augé August 14, 2008 2:31 PM
Hi Ray, I want to set up the Announcement (or... Richard Becher August 21, 2008 6:55 AM
hi ray, what should i use to create custom... Auditya manikanta Vadrevu October 15, 2008 3:50 AM
Hi Ray, I also would like to send an... Nicolas G. April 10, 2009 7:42 AM
Hy ray, I'm looking for newsletter capability... Denis Signoretto November 20, 2009 12:53 AM
Hi Nicolas, We are also looking for this... Luis Rodríguez Fernández November 16, 2010 7:28 AM
To send alerts/announcements to individual... Ray Augé November 16, 2010 7:38 AM
Hi Ray, Really, really thanks for your fast... Luis Rodríguez Fernández November 16, 2010 10:12 AM
Hi Ray, It works!!! Really thank you again! ... Luis Rodríguez Fernández November 17, 2010 12:16 AM
You got it! Good catch! Ray Augé November 17, 2010 5:31 AM
Hi Ray How can the announcement portlet be... Ibrahim Bakhit December 16, 2010 8:11 AM
Hmm, yeah. I've received similar requests... Ray Augé December 17, 2010 9:49 AM
Thanks Ray, this is good enough for my... Ibrahim Bakhit December 17, 2010 11:23 AM
Created LPS-14400 to track localization support... Ibrahim Bakhit December 20, 2010 3:41 PM
Great! I made a few updates to the issue... Ray Augé December 20, 2010 4:39 PM
Hi Ray, I need some help about the Alarm... Ivano Carrara January 18, 2011 8:46 AM
If you take a look under the user profile you... Ray Augé January 18, 2011 9:03 AM
Thank you Ray, but ... of course in the user... Ivano Carrara January 18, 2011 9:06 AM
hmm, I'm not sure what might be the problem! I... Ray Augé January 18, 2011 9:13 AM
I'm sorry ... It is a so big issue ... In... Ivano Carrara January 18, 2011 9:36 AM
I just created this tickets: "LPS-14825 - No... Ivano Carrara January 18, 2011 9:57 AM
Thank you Ivano! And sorry that I was not able... Ray Augé January 18, 2011 10:00 AM
Hi Ray ! Please, could you address us to... Ivano Carrara March 23, 2011 3:44 PM
Hi Ray, We have the same issue with 5.2 sp4... Vanita Chawla March 31, 2011 9:31 AM
Hi Mike, I just fixed the issue last night.... Ray Augé August 13, 2008 2:30 PM
This is a great addition to the capabilities! I... Brant Levinson March 11, 2009 8:49 PM
Why Announcements hidden by "Super Admin"... Shiva Iyer April 3, 2009 12:07 AM
Hy ray, I'm looking for newsletter capability... Denis Signoretto November 20, 2009 12:54 AM
Hi Ray, I think that announcements it's really... Denis Signoretto November 20, 2009 1:06 AM
Good question! Should be simple through... Ray Augé November 23, 2009 2:14 AM
Done ! http://issues.liferay.com/browse/LPS-6118 Denis Signoretto November 23, 2009 6:57 AM
Broadcast Control Question: I am looking enable... Tim Scholten December 16, 2009 7:15 AM
Depending on your version of the portal... Ray Augé December 16, 2009 7:29 AM
Hi Ray, I am also facing the same problem as... Pravin Pawar March 6, 2010 4:32 AM
Is there a plan to add a rich-text editor for... Andreas Stangl February 15, 2010 5:31 AM
There is a problem with the announcement... Boris Niyazov April 27, 2010 8:19 PM
Can someone please tell me how to use HTML tags... JohnnyBrew . September 14, 2011 1:43 PM
Hi, is there an example to create an alert... Mario Viertel August 24, 2012 4:05 AM
If you are referring to an overlay js/css based... Ray Augé August 24, 2012 10:02 AM
how can we change the default scope of... Imran Khalil November 1, 2012 3:34 AM
Hi Ray, I have the following question. We have... Gerard de Vos April 23, 2013 8:12 AM
Every user can also have a separate time zone.... Ray Augé April 23, 2013 8:58 AM
Ray, I'm just starting to try and use this API.... Joseph Toman December 15, 2014 1:04 AM
Hi Ray, Thanks for this features. But I've one... Varun Jain May 6, 2015 12:38 AM

Thanks for the new feature list. I can see this porlet getting lots and lots of use. A great add-on. I just have to take the time and properly configure my mail server now.

Is there any other location that lists the new features in 5.0?

Eric
Posted on 4/14/08 12:06 PM.
You can take a look at the Road Map (http://www.liferay.com/web/guest/139) but this isn't a complete list... as you can clearly see. emoticon

I believe there are changes coming to revise that roadmap though...

Cheers!
Posted on 4/14/08 12:27 PM in reply to Eric Brennan.
great feature!
When will you release Liferay 5.0?
cheers
christian
Posted on 4/14/08 3:00 PM in reply to Ray Augé.
Very Nice!
Have you planed to improve this feature by adding the possiblity to create annoucement in multi-language (Localized)?
It would be very useful!
Posted on 5/7/08 7:21 AM.
Yes, It's on my todo list. emoticon
Posted on 5/7/08 7:36 PM in reply to Michel Gelinas.
Hi, Ray
What are differences between Announcements and Alerts portlets?
(Except red frame around Alerts)

Thanx.
Posted on 5/29/08 8:58 AM.
The idea is that "Alerts" is hidden by default. Suppose if you placed it on User pages, later when you have an urgent message to display to some scope of users, you create an alert, and the portlet appears on their page (when they didn't even know it was there).
In this scenario, you also can take away the ability to remove it... so that they don't just get ride of it (do this by adding it using one of the static techniques: layout-templates, layout config).

About the style... it's really designed to be taken by a portal admin and make it look how ever you wish... The css is designed to be pretty friendly to suite. As well, each "type" of Alert can be styled to whatever purpose it might server.

- A "new feature" alert might be something eye catching and all hip "look at this new toy".
- A "warning" alert might be "Hey, you owe us money, pay your bill or we'll cancel your account."

Announcements are more of the day-to-day type of things, where a user can view the history of the Announcements they received (no history view for Alerts). Also, Announcements is more the type of portlet that a User "might" be free to remove form their page.

HTH!
Posted on 5/29/08 9:17 AM in reply to andrei harhots.
Appreciate your helpful answer, Ray!
Posted on 5/30/08 12:05 AM in reply to Ray Augé.
A great function indeed! Is the 'auto-hiding-when empty' working in 5.0.1 or is this feature yet to be implemented? Thnx, Peter
Posted on 6/30/08 3:11 PM in reply to andrei harhots.
Hi Ray,

I like the feature, but when there are no alerts to display it just says "No entries were found." (so the users do know it's there). Is there any way around this?

Mike
Posted on 8/1/08 9:11 PM in reply to Ray Augé.
Can I configure this portlet like the chat-portlet, so I don't have to added it to users' page. Or I can consume the remotes service (if it provided) with javascript to add a link on a page (using javascript in the theme) if new entries exist.
Posted on 8/13/08 10:39 AM in reply to Mike Cunneen.
Hi Mike,

I just fixed the issue last night. Sorry about that. The "Hide" feature works again. It had regressed.
Posted on 8/13/08 2:30 PM in reply to Mike Cunneen.
The remote service (including javascript) is complete, as such you should be able to consume the full array of features.
Posted on 8/13/08 2:32 PM in reply to Allen Chiang.
Hi Ray,
That's great! Thanks!
So the portlet doesn't need in any one of a user's page if I am only use the service script, right ?
Thanks again.

Allen
Posted on 8/14/08 9:36 AM in reply to Ray Augé.
If I understand correctly, you just want to use the service with your own UI implementation, then you are correct. You would not require the portlet at all, simply use the service to handle all the CRUD operations.

Note there is one Utility class (which is not directly part of the service) which will be important to aggregate the "scopes" available to a given user.

LinkedHashMap<Long, long[]> scopes = AnnouncementsUtil.getAnnouncementScopes(user.getUserId());

"scopes" is then passed into the:

AnnouncementsEntryLocalServiceUtil.getEntries()

as a parameter which constrains the returned results to all those scopes to which the user belongs.
Posted on 8/14/08 2:31 PM in reply to Allen Chiang.
Hi Ray,

I want to set up the Announcement (or Alerts) to send an email to each of the specified users within the Scope specified. Is there a way to do this WITHOUT forcing each user to subscribe to it?

Thanks in advance!
Posted on 8/21/08 6:55 AM in reply to Ray Augé.
hi ray,
what should i use to create custom program using API for announcements to particular user only
Posted on 10/15/08 3:50 AM in reply to Ray Augé.
This is a great addition to the capabilities! I am able to get the Announcements to work, although I setup an Alert including the time/date and put it on a page for a user. Then logged in as the user and waited until that time, but the Alert never came. Nothing is shown where the portlet was placed. Is that setup how's it supposed to work? I refreshed as well and still did not see it. I made the scope be the entire organization and logged in as a user in that organization.
Posted on 3/11/09 8:49 PM in reply to Ray Augé.
Why Announcements hidden by "Super Admin" (test@liferay.com) is visible for "Normal users". Is announcement are hide at personal level or depending on the Distribution Scope.
Posted on 4/3/09 12:07 AM.
Hi Ray,
I also would like to send an announcement to an individual user ; in your article you speak about using an API to do that. Could you please precise a little bite more ...
Many many thanks in advance,
Regards,
Nico
Posted on 4/10/09 7:42 AM in reply to auditya manikanta vadrevu.
Hy ray, I'm looking for newsletter capability on Liferay. I'm wondering if I can use announcements to send all community users an HTML email athoring it with HTML Text Area or even more as a WebContent. How can I do it?

Is there a wiki page or any other complete documentation about alerts and announcement?

Thanks,
Denis.
Posted on 11/20/09 12:53 AM in reply to Nicolas G..
Hy ray, I'm looking for newsletter capability on Liferay. I'm wondering if I can use announcements to send all community users an HTML email athoring it with HTML Text Area or even more as a WebContent. How can I do it?

Is there a wiki page or any other complete documentation about alerts and announcement?

Thanks,
Denis.
Posted on 11/20/09 12:54 AM.
Hi Ray, I think that announcements it's really nice and important feature. Why don't add it on Control Panel?

D.
Posted on 11/20/09 1:06 AM.
Good question!

Should be simple through configuration. Could you submit a feature request ticket to JIRA?

Thanks
Posted on 11/23/09 2:14 AM in reply to Denis Signoretto.
Done !

http://issues.liferay.com/browse/LPS-6118
Posted on 11/23/09 6:57 AM in reply to Ray Augé.
Broadcast Control Question:
I am looking enable all users of a particular community to have the permissions to make announcements. This works if I grant them "Add Entry" & "community owner " permissions... however having all users with the "community owner" role enables too much and is not desirable.

So the crux of my question is, is it possible to give all members of the community permissions required for broadcasting Announcements to the community scope?

I am just beginning to understand how Liferay handles permissions but, I am wondering if there is away that only the Announcements portlet is enabled for these users with the Community Owner role (or functional equivalent) and not the entire portal page.

Tim
Posted on 12/16/09 7:15 AM.
Depending on your version of the portal (anything > 5.1.2 I think), there should be a Manage Announcements permission for each "scope" resource, such as Community, User Group, Organization, etc.
Posted on 12/16/09 7:29 AM in reply to Tim Scholten.
Is there a plan to add a rich-text editor for announcements? Currently I am able to write html code by hand but it would be nice to have some wysiwyg editor.
Posted on 2/15/10 5:31 AM.
Hi Ray,
I am also facing the same problem as Tim. I have added add Entry & configuration permission to member of organization having HR as a organization role. Still that user is unable to add announcement and gets "You have entered invalid data. Please try again." error message. For distribution scope dropdown values are not shown, only optgroups are displayed.
Posted on 3/6/10 4:32 AM in reply to Ray Augé.
There is a problem with the announcement distribution scope. Looks like the roles distribution scope doesn't work when users assigned to the role implicitly via user group. The user must be explicitly assigned to the role in order to see the announcement with the distribution scope for the role. We use LR 5.2.3
Posted on 4/27/10 8:19 PM.
Hi Nicolas,

We are also looking for this funcionality. I mean, we also would like to send and announcement to an individual user. Have you finally resolved this?

Really thanks,

Luis
Posted on 11/16/10 7:28 AM in reply to Nicolas G..
To send alerts/announcements to individual users do:

AnnouncementsEntryLocalServiceUtil.addEntry(userIdOfCurrentUser, User.class.getName(), targetUserId, title, content, url, type, displayDateMonth, displayDateDay, displayDateYear, displayDateHour, displayDateMinute, expirationDateMonth, expirationDateDay, expirationDateYear, expirationDateHour, expirationDateMinute, priority, alert);
Posted on 11/16/10 7:38 AM in reply to Luis Rodríguez Fernández.
Hi Ray,

Really, really thanks for your fast answer!!! We are not at the office at the moment, but tomorrow it is the first thing we are going to do at work.

Best regards,

Luis
Posted on 11/16/10 10:12 AM in reply to Ray Augé.
Hi Ray,

It works!!! Really thank you again!

Best regards,

Luis

ps: only one, the method ask for a long value in the second parameter, so we should use:

long userClassNameId = PortalUtil.getClassNameId(User.class);
Posted on 11/17/10 12:16 AM in reply to Ray Augé.
You got it! Good catch!
Posted on 11/17/10 5:31 AM in reply to Luis Rodríguez Fernández.
Hi Ray
How can the announcement portlet be customized to support localization or better yet be integrated with existing liferay WCM capabilities?
Thanks
Posted on 12/16/10 8:11 AM in reply to Ray Augé.
Hmm, yeah. I've received similar requests before, but haven't yet had time to work on them. Is there a ticket in the Community Backlog on JIRA? That's where we would start.

There may be a few quick hacks you could make to get it working with WCM, but it's kind of quirky. Basically replace the title and content fields with the groupId and articleId values of a selected article (you'd have to copy the code for one of the article selectors we have in the portal, i.e. in asset publisher) and then on render use the JournalContentUtil to render the article using the groupId and articleId values stored in the title and content fields. Note you'd also have to alter the Message listener that sends out messages via Email and SMS to do the same.

Hack-ish, but may do what you want in the short term.
Posted on 12/17/10 9:49 AM in reply to Ibrahim Bakhit.
Thanks Ray, this is good enough for my purposes. It is an admin side work and not client facing, so it is not as bad.

As for JIRA, I will search Community Backlog later and if there isn't a ticket on the issue, I will open one.

Thanks again and stay warm!
Posted on 12/17/10 11:23 AM in reply to Ray Augé.
Created LPS-14400 to track localization support and/or integration of Announcement Portlet with Liferay WCM. I hope that is what is needed.
Posted on 12/20/10 3:41 PM in reply to Ibrahim Bakhit.
Great! I made a few updates to the issue details. Filed under "Community Backlog", also added to "Portlet - Announcements" component, also removed specified backports. We can determine if backport is feasible when that time comes (i.e. if we have to change the DB for any reason, we wouldn't be able to backport).

Thanks Ibrahim!
Posted on 12/20/10 4:39 PM in reply to Ibrahim Bakhit.
Hi Ray, I need some help about the Alarm portlet..

I'm able to send alarms via email to Administrator scope from the Administrator user.

This is the unique scope reachable via email ... The Administrator is not able to send alarms via email to any scope ! Note that on the appropriate Web pages, the alarms shows up for the appropriate User/scope. I'm using the official 6.0.5 version of Community Edition.

Please, could you help me ? Thank you in advance ! Ivano
Posted on 1/18/11 8:46 AM in reply to Ray Augé.
If you take a look under the user profile you will see "Announcements". Each user can opt in or out of which type of alerts/announcements get sent via email (or SMS). So, if you want to force alerts to be sent via email or SMS, you might need to add an override for that user setting.
Posted on 1/18/11 9:03 AM in reply to Ivano Carrara.
Thank you Ray, but ... of course in the user profile of the destination user there is the flag "email" checked" !
Posted on 1/18/11 9:06 AM in reply to Ray Augé.
hmm, I'm not sure what might be the problem! I don't know what to suggest. Unfortunately I don't have time at the moment to test it myself! Perhaps if you search JIRA (http://issues.liferay.com) for related tickets, it might be a bug that is either pending, or if lucky, fixed since then. If not please if you could file a ticket!
Posted on 1/18/11 9:13 AM in reply to Ivano Carrara.
I'm sorry ... It is a so big issue ... In fact, actually the only delivery method to send Alarms is via Web pages, and only the Administrator is able to send emails to Administrator scope !

It is strange that nobody found this issue... maibe it is my fault ...

I'll try to search and/or submit a ticket ...

Thank you!
Posted on 1/18/11 9:36 AM in reply to Ray Augé.
I just created this tickets: "LPS-14825 - No emails sent from the Alarms portlet - only emails from the Administrator to Administrator scope was delivered"

Thank you in advance for any help !
Posted on 1/18/11 9:57 AM in reply to Ivano Carrara.
Thank you Ivano! And sorry that I was not able to give you a quick solution!
Posted on 1/18/11 10:00 AM in reply to Ivano Carrara.
Hi Ray !

Please, could you address us to understand how the Announcements portlet send messages via SMS ? I need to catch the messages and routing it to my SMS delivery system.

Thank you in advance !

Ivano C.
Posted on 3/23/11 3:44 PM in reply to Ray Augé.
Hi Ray,

We have the same issue with 5.2 sp4 EE. No email being sent to the user even when user has opted in for Ammouncement alerts. We'll open a ticket.

Thanks!
Vanita
Posted on 3/31/11 9:31 AM in reply to Ivano Carrara.
Can someone please tell me how to use HTML tags within the Content section of an Announcement? I'd like to add line breaks, urls, etc. THANKS!
Posted on 9/14/11 1:43 PM.
Hi, is there an example to create an alert using SOAPUI?

TIA Mario
Posted on 8/24/12 4:05 AM.
If you are referring to an overlay js/css based "alert" this is not the type of Alert this post is talking about. What we mean here is an alert in the sense of a communique targeted at some subset of users which they will receive either through the portal UI, email or over SMS.

If you are looking for an overlay js/css based "alert" you'll want to look for javascript, alloy, jQuery kind of references in the Forums or elsewhere etc.
Posted on 8/24/12 10:02 AM in reply to Mario Viertel.
how can we change the default scope of announcements tab...
Posted on 11/1/12 3:34 AM.
Hi Ray,

I have the following question. We have several development environments. On the production-environment the default time is not correct configured. Instead of 16.59 the shown time is 3.59. There is a time difference of 13 hours. All other environment show the correct time!

I can't figure out how to get the default time correct. By the way, the local time on the server is correct.

Can you help me?

Kind Regards,
Gerard de Vos
Posted on 4/23/13 8:12 AM.
Every user can also have a separate time zone. Make sure that for anyone involved in the process, the timezones are set as expected.
Posted on 4/23/13 8:58 AM in reply to Gerard de Vos.
Ray, I'm just starting to try and use this API. You mentioned Read Tracking above. Could you talk a little more about that? I don't see anything offhand in the API to facilitate that. Thanks.
Posted on 12/15/14 1:04 AM.
Hi Ray,

Thanks for this features.
But I've one questions that is it available for Liferay 6.1 CE

Regards,
Varun Jain
Posted on 5/6/15 12:38 AM.