Announcements and Alerts

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.

Blogs
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
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!
Hi, Ray
What are differences between Announcements and Alerts portlets?
(Except red frame around Alerts)

Thanx.
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!
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
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.
The remote service (including javascript) is complete, as such you should be able to consume the full array of features.
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
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.
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!
hi ray,
what should i use to create custom program using API for announcements to particular user only
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
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.
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
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);
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
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);
Hi Ray
How can the announcement portlet be customized to support localization or better yet be integrated with existing liferay WCM capabilities?
Thanks
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.
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!
Created LPS-14400 to track localization support and/or integration of Announcement Portlet with Liferay WCM. I hope that is what is needed.
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!
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
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.
Thank you Ray, but ... of course in the user profile of the destination user there is the flag "email" checked" !
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!
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!
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 !
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.
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
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.
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.
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.
Hi Ray, I think that announcements it's really nice and important feature. Why don't add it on Control Panel?

D.
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
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.
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.
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.
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
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!