@StableMinor(version="12.3", sinceVersion="8.2") public class EmailNotifier extends Object implements IActivityUserNotifier
UserConfig.getEmail()
.Constructor and Description |
---|
EmailNotifier() |
Modifier and Type | Method and Description |
---|---|
protected IMultipleMail |
createMail(ActivityDocument.IActivity activity,
Collection<UserConfig> users,
Locale emailLocale)
Creates an
IMultipleMail from the ActivityDocument.IActivity . |
protected String |
getEmailBody(ActivityDocument.IActivity activity,
Locale locale)
Generate an e-mail body for the activity.
The default implementation gets the localized STR_EMAIL_HTML_BODY, and runs the EL evaluator to return the complete body HTML. |
protected Collection<IMailDestination> |
getEmailDestinations(ActivityDocument.IActivity activity,
Collection<UserConfig> users)
Generate a list of email destinations to be added to an email of the activity.
the default implementation adds all users that have an email to the list. |
protected String |
getEmailSubject(ActivityDocument.IActivity activity,
Locale locale)
Generate an e-mail subject for the activity.
The default implementation gets the localized STR_EMAIL_SUBJECT, and runs the EL evaluator to return the complete subject. |
protected Locale |
getLocaleForEmail(ActivityDocument.IActivity activity)
Returns the locale to localize the email
|
void |
notify(ActivityDocument activityDocument,
Collection<UserConfig> users)
Sends a notification to
users about the activity that has occurred. |
public void notify(ActivityDocument activityDocument, Collection<UserConfig> users) throws PortalException
IActivityUserNotifier
users
about the activity that has occurred.notify
in interface IActivityUserNotifier
activityDocument
- the document of the activity that has occurred.users
- the users to receive the notification.PortalException
protected IMultipleMail createMail(ActivityDocument.IActivity activity, Collection<UserConfig> users, Locale emailLocale) throws PortalException
IMultipleMail
from the ActivityDocument.IActivity
. IMultipleMail
from the ISendMailManager
, and sets the
subject by calling EmailNotifier#getEmailSubject(IActivity, Locale)
, the body by calling
EmailNotifier#getEmailBody(IActivity, Locale)
and the source component is set to
"Activity Stream E-Mail Notifier".activity
- the activity to generate the notification e-mail forusers
- the users that should receive the email.emailLocale
- the Locale to for e-mail localization.IMultipleMail
with all informations set.PortalException
protected String getEmailSubject(ActivityDocument.IActivity activity, Locale locale) throws PortalException
activity
- The activity to use when creating the subjectlocale
- The locale for string localizationPortalException
protected String getEmailBody(ActivityDocument.IActivity activity, Locale locale) throws PortalException
activity
- The activity to use when creating the bodylocale
- The locale for string localizationPortalException
protected Locale getLocaleForEmail(ActivityDocument.IActivity activity) throws PortalException
activity
- the activity that will have the email generatedPortalException
protected Collection<IMailDestination> getEmailDestinations(ActivityDocument.IActivity activity, Collection<UserConfig> users) throws PortalException
activity
- the activity for the destinationusers
- the list of users to add to the destinationPortalException
LumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.