Package org.openbravo.portal
Class NewUserEmailGenerator
- java.lang.Object
-
- org.openbravo.portal.NewUserEmailGenerator
-
- All Implemented Interfaces:
EmailEventContentGenerator
public class NewUserEmailGenerator extends Object implements EmailEventContentGenerator
Email generator forGrantPortalAccessProcess.EVT_NEW_USER
event which is triggered when a user is granted with portal privileges.- Author:
- asier
-
-
Constructor Summary
Constructors Constructor Description NewUserEmailGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<File>
getAttachments(Object data, String event)
Returns the list of files to be attached to the email.String
getBody(Object data, String event)
Returns the email body for the event and data.String
getContentType()
Returns the type of content of the email.int
getPriority()
When there are several classes listening to the same event, the order the emails are sent is based on this value.String
getSubject(Object data, String event)
Returns the email subject for the event and data.boolean
isAsynchronous()
Asynchronous emails are sent in a separate thread not waiting them to finish to continue the rest of the execution flow.boolean
isValidEvent(String event, Object data)
Checks if an email should be generated for theevent
.boolean
preventsOthersExecution()
In case there are several classes listening to the same event, when this method returnstrue
, other emails with lower priority that might exist, will not be sent.
-
-
-
Method Detail
-
getSubject
public String getSubject(Object data, String event)
Description copied from interface:EmailEventContentGenerator
Returns the email subject for the event and data.- Specified by:
getSubject
in interfaceEmailEventContentGenerator
-
getBody
public String getBody(Object data, String event)
Description copied from interface:EmailEventContentGenerator
Returns the email body for the event and data.- Specified by:
getBody
in interfaceEmailEventContentGenerator
-
getContentType
public String getContentType()
Description copied from interface:EmailEventContentGenerator
Returns the type of content of the email. Tipically"text/html; charset=utf-8"
or"text/plain; charset=utf-8"
- Specified by:
getContentType
in interfaceEmailEventContentGenerator
-
isValidEvent
public boolean isValidEvent(String event, Object data)
Description copied from interface:EmailEventContentGenerator
Checks if an email should be generated for theevent
. Same class can be listening to several events.- Specified by:
isValidEvent
in interfaceEmailEventContentGenerator
- Parameters:
event
- Event to checkdata
- Data the email will be generated for (this can also determine whether the email must be sent)- Returns:
true
if the email must be sent,false
if not.
-
getPriority
public int getPriority()
Description copied from interface:EmailEventContentGenerator
When there are several classes listening to the same event, the order the emails are sent is based on this value.- Specified by:
getPriority
in interfaceEmailEventContentGenerator
- See Also:
EmailEventContentGenerator.preventsOthersExecution()
-
preventsOthersExecution
public boolean preventsOthersExecution()
Description copied from interface:EmailEventContentGenerator
In case there are several classes listening to the same event, when this method returnstrue
, other emails with lower priority that might exist, will not be sent.- Specified by:
preventsOthersExecution
in interfaceEmailEventContentGenerator
-
isAsynchronous
public boolean isAsynchronous()
Description copied from interface:EmailEventContentGenerator
Asynchronous emails are sent in a separate thread not waiting them to finish to continue the rest of the execution flow.- Specified by:
isAsynchronous
in interfaceEmailEventContentGenerator
-
getAttachments
public List<File> getAttachments(Object data, String event)
Description copied from interface:EmailEventContentGenerator
Returns the list of files to be attached to the email. Return null for no attachments- Specified by:
getAttachments
in interfaceEmailEventContentGenerator
-
-