ART-BPMS-MAILING is a java module providing possibility to send emails using SMTP from a Camunda process.
- Sending emails using SMTP
- Attaching images to an email if they are in the email template
- Open your project's pom
- Add a reference to the artezio mvn repository:
<repository> <id>artezio</id> <url>https://nexus.artezio.net/repository/maven-releases</url> </repository>
- Add the dependency:
<dependency> <groupId>com.artezio.bpm.camunda</groupId> <artifactId>camunda-mailing</artifactId> <version>${camunda-mailing.version}</version> </dependency>
com.artezio.bpm.camunda.mailing.MailSenderDelegate service looks for the session with JNDI java:global/camunda-bpm-platform/mail/com.artezio.bpm.camunda
so use this name in your session's settings to make it visible to the service. For other settings of java.mail.Session see corresponding documentation.
For processing/generating mail templates Apache FreeMarker library is used. All you need to start working with ART-BPMS-MAILING is to create mail templates and add them to a process deployment, add a task implemented by the service and start the process.
Detailed steps:
- Create mail templates for message's subject and body using the following naming formats:
{template_name}_subject.ftland{template_name}_body.ftl(see FreeMarker guide for information about creating templates). If you use images in email you should provide the names of the images inmailImageNamesenvironment variable (see Process variables section). - Add created templates to a process deployment
- On a process's diagram put either
Service TaskorSend Taskcomponent withDelegate Expressionimplementation - Select the put component and write
${mailSenderDelegate}into fieldDelegate Expression

mailSender- an email sender name, sectionFromof an email. Required variable.mailRecipients- an email recipient list, sectionToof an email. Required variable.mailCcRecipients- 'copy' email recipient list, sectionCcof an email. Optional variable.mailBccRecipients- 'blind copy' email recipient list, sectionBccof an email. Optional variable.mailTemplate- a full path to an email template without_subject.ftland_body.ftlsuffixes. Required variable.mailImageNames- the list of the full paths to images used in an email. Optional variable.