| java.lang.Object org.sakaiproject.util.EmailNotification
All known Subclasses: org.sakaiproject.util.SiteEmailNotification,
EmailNotification | public class EmailNotification implements NotificationAction(Code) | |
EmailNotification is the notification action that handles the act of message (email) based notify, site related, with user preferences.
The following should be specified to extend the class:
- getRecipients() - get a collection of Users to send the notification to
- getHeaders() - form the complete message headers (like from: to: reply-to: date: subject: etc). from: and to: are for display only
- getMessage() - form the complete message body (minus headers)
- getTag() - the part of the body at the end that identifies the list
- isBodyHTML() - say if your body is html or not (not would be plain text)
getClone() should also be extended to clone the proper type of object.
|
Method Summary | |
protected List | digestRecipients(List recipients, Notification notification, Event event) Filter the recipients Users into the list of those who get this one by digest. | protected String | findHeader(String header, List headers) Find the header line that begins with the header parameter
Parameters: header - The header to find. Parameters: headers - The list of full header lines. | protected String | findHeaderValue(String header, List headers) Find the header value whose name matches with the header parameter
Parameters: header - The header to find. Parameters: headers - The list of full header lines. | public NotificationAction | getClone() Make a new one like me. | protected String | getFrom(Event event) | protected String | getFromEventUser(Event event) Format the from user email address based on the user generating the event (current user).
Parameters: event - The event that matched criteria to cause the notification. | protected String | getFromService() Format a from address from the service, no reply. | protected List | getHeaders(Event event) Get headers for the email (List of String, full header lines) - including Subject: Date: To: From: if appropriate, as well as any others
Parameters: event - The event that matched criteria to cause the notification. | protected String | getMessage(Event event) Get the message for the email.
Parameters: event - The event that matched criteria to cause the notification. | protected int | getOption(User user, Notification notification, Event event) Get the user's notification option for this... | protected List | getRecipients(Event event) Get the list of User objects who are eligible to receive the notification email.
Parameters: event - The event that matched criteria to cause the notification. | protected String | getSite() Get the site id this notification is related to. | protected String | getTag(String newline, String title) Get the message tag, the text to display at the bottom of the message.
Parameters: newline - The newline character(s). Parameters: title - The title string. | protected List | immediateRecipients(List recipients, Notification notification, Event event) Filter the recipients Users into the list of those who get this one immediately. | protected boolean | isBodyHTML(Event event) Return true if the body of the email message should be sent as HTML. | protected boolean | isImmediateDeliveryOption(int option, Notification notification) Filter the preference option based on the notification resource type
Parameters: option - The preference option. Parameters: notification - The notification responding to the event. | public void | notify(Notification notification, Event event) Do the notification. | public void | set(Element el) Set from an xml element. | public void | set(NotificationAction other) Set from another. | public void | toXml(Element el) Fill this xml element with the attributes. |
m_siteId | protected String m_siteId(Code) | | The related site id.
|
EmailNotification | public EmailNotification()(Code) | | Construct.
|
EmailNotification | public EmailNotification(String siteId)(Code) | | Construct.
Parameters: siteId - The related site id. |
digestRecipients | protected List digestRecipients(List recipients, Notification notification, Event event)(Code) | | Filter the recipients Users into the list of those who get this one by digest. Combine the event's notification priority with the user's notification profile.
Parameters: recipients - The List (User) of potential recipients. Parameters: notification - The notification responding to the event. Parameters: event - The event that matched criteria to cause the notification. The List (User) of digest recipients. |
findHeader | protected String findHeader(String header, List headers)(Code) | | Find the header line that begins with the header parameter
Parameters: header - The header to find. Parameters: headers - The list of full header lines. The header line found or null if not found. |
findHeaderValue | protected String findHeaderValue(String header, List headers)(Code) | | Find the header value whose name matches with the header parameter
Parameters: header - The header to find. Parameters: headers - The list of full header lines. The header line found or null if not found. |
getFrom | protected String getFrom(Event event)(Code) | | Format a From: respecting the notification service replyable configuration
Parameters: event - |
getFromEventUser | protected String getFromEventUser(Event event)(Code) | | Format the from user email address based on the user generating the event (current user).
Parameters: event - The event that matched criteria to cause the notification. the from user email address based on the user generating the event. |
getFromService | protected String getFromService()(Code) | | Format a from address from the service, no reply.
a from address from the service, no reply. |
getHeaders | protected List getHeaders(Event event)(Code) | | Get headers for the email (List of String, full header lines) - including Subject: Date: To: From: if appropriate, as well as any others
Parameters: event - The event that matched criteria to cause the notification. the additional headers for the email. |
getMessage | protected String getMessage(Event event)(Code) | | Get the message for the email.
Parameters: event - The event that matched criteria to cause the notification. the message for the email. |
getOption | protected int getOption(User user, Notification notification, Event event)(Code) | | Get the user's notification option for this... one of the NotificationService's PREF_ settings
|
getRecipients | protected List getRecipients(Event event)(Code) | | Get the list of User objects who are eligible to receive the notification email.
Parameters: event - The event that matched criteria to cause the notification. the list of User objects who are eligible to receive the notification email. |
getSite | protected String getSite()(Code) | | Get the site id this notification is related to.
The site id this notification is related to. |
getTag | protected String getTag(String newline, String title)(Code) | | Get the message tag, the text to display at the bottom of the message.
Parameters: newline - The newline character(s). Parameters: title - The title string. The message tag. |
immediateRecipients | protected List immediateRecipients(List recipients, Notification notification, Event event)(Code) | | Filter the recipients Users into the list of those who get this one immediately. Combine the event's notification priority with the user's notification profile.
Parameters: recipients - The List (User) of potential recipients. Parameters: notification - The notification responding to the event. Parameters: event - The event that matched criteria to cause the notification. The List (User) of immediate recipients. |
isBodyHTML | protected boolean isBodyHTML(Event event)(Code) | | Return true if the body of the email message should be sent as HTML. If this returns true, getHeaders() should also return a "Content-Type: text/html" header of some kind.
Parameters: event - The event that matched criteria to cause the notification. whether the body of the email message should be sent as HTML. |
isImmediateDeliveryOption | protected boolean isImmediateDeliveryOption(int option, Notification notification)(Code) | | Filter the preference option based on the notification resource type
Parameters: option - The preference option. Parameters: notification - The notification responding to the event. A boolean value which tells if the User is one of immediate recipients. |
notify | public void notify(Notification notification, Event event)(Code) | | Do the notification.
Parameters: notification - The notification responding to the event. Parameters: event - The event that matched criteria to cause the notification. |
set | public void set(Element el)(Code) | | Set from an xml element.
Parameters: el - The xml element. |
toXml | public void toXml(Element el)(Code) | | Fill this xml element with the attributes.
Parameters: el - The xml element. |
|
|