List of usage examples for com.liferay.portal.kernel.notifications NotificationEvent setDeliveryType
public void setDeliveryType(int deliveryType)
From source file:com.liferay.invitation.invite.members.service.impl.MemberRequestLocalServiceImpl.java
License:Open Source License
protected void sendNotificationEvent(MemberRequest memberRequest) throws PortalException { String portletId = PortletProviderUtil.getPortletId(MemberRequest.class.getName(), PortletProvider.Action.EDIT); if (UserNotificationManagerUtil.isDeliver(memberRequest.getReceiverUserId(), portletId, 0, MembershipRequestConstants.STATUS_PENDING, UserNotificationDeliveryConstants.TYPE_WEBSITE)) { JSONObject notificationEventJSONObject = JSONFactoryUtil.createJSONObject(); notificationEventJSONObject.put("classPK", memberRequest.getMemberRequestId()); notificationEventJSONObject.put("userId", memberRequest.getUserId()); NotificationEvent notificationEvent = NotificationEventFactoryUtil .createNotificationEvent(System.currentTimeMillis(), portletId, notificationEventJSONObject); notificationEvent.setDeliveryRequired(0); notificationEvent.setDeliveryType(UserNotificationDeliveryConstants.TYPE_WEBSITE); userNotificationEventLocalService.addUserNotificationEvent(memberRequest.getReceiverUserId(), true, notificationEvent);//from w ww. j a v a 2 s . c o m } }