Announcements/Alerts to a particular user

Announcements/Alerts portlet

Through this portlet we can send Announcements/alerts to different types  such as Guests, Organisations, Communities, User Groups, Roles and General (already known and existing).

Now, we can send Announcements/alerts to a particular user only (whether he may a part of community or organisation) based on screen names by adding a new type in Distribution scope of Announcements/alerts known as "Users".

 

here in the distribution scope, "Auditya" is a user screen name .

Add the following code to enable it

                    <optgroup label="<liferay-ui:message key="users" />">
     <%
     int nbrUser = UserLocalServiceUtil.getUsersCount();
     List<User> allUSers = UserLocalServiceUtil.search(company.getCompanyId(),null, null, null, 0, nbrUser, null); 

                        for (User totalusers : allUSers) {

                                <option <%= (classPK == totalusers.getUserId()) ? "selected" : "" %> value="<%= PortalUtil.getClassNameId(User.class) %><%= StringPool.COMMA %><%= totalusers.getUserId() %>"><%= totalusers.getScreenName() %></option>

                                                <%
                                                }
                                                %>       

                                        </optgroup>

in

edit_entry.jsp & view.jsp in /html/portlet/announcments folder

Blogs
Hi auditya,

Is the above code enough for sending to a particular user or I have to make any changes in the Action class?
hi faisal,

yes just add this code thats all, no other changes required in action classes .