Help is available by sending an email to csf-support@mit.edu
Have any suggestion on how improve this wiki? Please give us your feedback at csf-support@mit.edu
Email properties
You will have to configure the following in your application properties file:
- email.address.from: the from address of the email
- email.address.test.to: the email address that email will sent to when production mode is false
- email.address.bcc: the bcc address of the email
- email.production.mode: set to true when in production, set to false when in development/test
- email.app.id: the app id of the application using the EmailService.
Need more information about the email properties? Go to the CSF Email properties description for more information.
Session Factory
In order to access the hibernate mappings used by the EmailService, you need to add the following property in the sesionFactory bean of your applicationContext:
<property name="mappingLocations"> <list> <value>classpath*:edu/mit/es/csf/email/hibernate/*.hbm.xml</value> </list> </property>
Need more information about session factory and hibernate mappings? Go to the How to configure your application to use Hibernate Mappings for more information.
Email attachments
CSF EmailService currently supports 2 types of attachment: list of File objects and list of attachments:
- List of file objects: use method sendEmailWithAttachments(EmailModel emailModel, List<File> attachments). There is also another method that supports attaching a file and generating email text with a velocity template.
- List of datasource(s): use method sendEmailWithAttachmentsFromDataSource(EmailModel emailModel, List<Datasource> attachments, Boolean useApplicationConfig).