Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Corrected links that should have been relative instead of absolute.
Info

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

Panel
Wiki Markup
{anchor:Maven dependency}
h3.Maven dependency

Add the following dependency to your project's pom.xml.
{code}
<dependency>
    <groupId>edu.mit.ist.es.csf</groupId>
    <artifactId>csf-email</artifactId>
    <version>[0.0.0,999.999.999)</version>
</dependency>
{code}

Panel

Anchor
Email properties
Email properties

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.
Tip

Need more information about the email properties?  Go to the CSF Email properties description for more information.

Panel
Wiki Markup
{anchor:Session Factory}
h3.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:
{code}
<property name="mappingLocations">
    <list>
        <value>classpath*:edu/mit/es/csf/email/hibernate/*.hbm.xml</value>
    </list>
</property>  
{code}
{tip}
Need more information about the session factory and hibernate mappings?&nbsp;&nbsp;Go to the [How to configure your application to use Hibernate Mappings | How to configure your application to use Hibernate Mappings] for more information.
{tip}
Panel

Anchor
Email Features
Email Features

Email features

  1. 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).
  2. Sending bulk email (using the EmailModel object) with and without velocity templates.
  3. Pre-configured applicationContext files to be used by the application.
    • applicationContext-csf-email-component-scan.xml – the configuration file that contains scan for all email service beans.
    • applicationContext-csf-email-config.xml - the configuration file that contains all the beans defined for email Service.
    • applicationContext-csf-email-scheduler.xml – the configuration file that contains the default scheduler to send and delete emails.
    • applicationContext-csf-email.xml – the default csf-email configuration file that contains all of the above configuration files.