Camunda Process Automation – How to send custom template in the body of email

Technology Troubleshooting

Camunda Process Automation – How to send custom template in the body of email

blog-2

An Overview

Are you finding it challenging to get the custom email template in Camunda BPMN in a send mail task?

We also found it challenging and after quite a few trials we found the solution.

What is Camunda?

In case you are new to Camunda, it is an open-source workflow and decision automation tool that helps us build workflow management easily and quickly without much technical knowledge.

You could read more about Camunda and its application at https://camunda.com/

Getting the custom email template in Camunda BPMN in send mail task.
Use case:

Notify the user via email for the assigned or pending tasks to be completed.

The problem we faced:

While we could integrate the send email for processes via send mail task in camunda, we were finding it difficult to send custom email templates as per companies/client’s branding.

We tried various methods to send the email but every time the mail used to come without body text. In a few cases, we could get the plain text in the email body but that was not fulfilling our objective. We wanted the template to be styled with our client’s branding guidelines.

Steps we took to resolve this issue:

Step1: We did research and found that camunda supports a template engine called  “Freemarker” for email templates. We created one freemarker (.ftl) file from our email template in HTML. So camunda will read this .ftl file as the email template in the body part of the email.

Open your HTML in a text editor and save the file in .flt format

Freemarker is pre-installed in the camunda package distribution. Apache FreeMarker™ is a template engine. It is a Java library to generate text output (HTML web pages, e-mails, configuration files, source code, etc.) based on templates and changing data.

You can check more information on Freemarker on the below link:

https://freemarker.apache.org/

Step 2: Now save this file in the locations shown below in the camunda project folder. For eg: welcome.ftl

File Location1: <path>/camunda-bpm-tomcat-7.12.0/server/apache-tomcat-9.0.24/lib

File Location2: <path>/camunda-bpm-tomcat-7.12.0/server/apache-tomcat-9.0.24/webapps/camunda/WEB-INF/classes/org/camunda/bpm/tasklist/impl/plugin/resources

Step3: Go to Camunda BPMN and open the send mail task.

Below is the sample for the reference to set up the send email with:

In the Input/Output parameter, mention html:script in the input parameter
In the Input Parameter, give Name as html, select Type as a script, script format as freemarker, select Script Type as External Resource, Resource as welcome.html

Now save this BPMN file and deploy to the server

Run the email task process to see the final result

I hope this article will be a useful example of resolving “custom email templates in Camunda”.

Stay tuned to read many such useful articles.

Keep yourself safe, environment clean & wash your hands regularly.

#stayhome #staysafe #stopthespread #spreadkindness #socialdistancing #quarantine #stayhealthy

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

UI Developer

Job Description


This is a hot opening and we are looking to hire as soon as possible. 

Candidates having 7-8 years of experience as UI developer. Minimum 2 years experience in React.js

Primary Skill (Mandatory): React.js, Advanced JavaScript, HTML5, CSS3, Redux/Context

Secondary Skills (Good to have): Conversion rate optimization (CRO)/AB Testing tool preferably “Convert”

Key Responsibilities:

  • In-depth knowledge of HTML, CSS, Sass and strong knowledge on Object Oriented JavaScript and Ajax, jQuery and any other CSS framework like Material Ui or Bootstrap
  • Strong proficiency & thorough understanding in JavaScript, including DOM manipulation and the JavaScript object model, React.js (Include hooks)
  • Experience using A/B Testing Tool such as “Convert”
  • Should be a self-starter with high initiative, team player, with problem solving abilities.
  • Responsible for development of new highly responsive, web-based user interface
  • Develop clean, secure, extensible, reusable, and maintainable code meeting existing architectural standards
  • Should be good in writing automated unit tests in React & JavaScript
  • Review functional requirements, providing technical feedback on feasibility and architectural approach and framework.
  • Collaborate with middleware engineers to deliver performant web applications
  • Experience in release management and version management tools (e.g. GIT hub, JIRA, bit bucket etc.)
  • Experience with web services (consuming or creating) with REST, Web Sockets or Graphql
  • Very good interpersonal, analytical, problem-solving, and written & verbal communication skills
  • Understand requirements through regular interaction with concerned stakeholders including counterparts in the other offices
  • Utilize Agile Development, SCRUM / Pair / Extreme Programming methodologies

This will close in 0 seconds

Senior Fullstack Middleware Engineer

Job Description


This is a hot opening and we are looking to hire as soon as possible. 

Opportunity for Full stack Middleware Developer

Primary Skills (Mandatory): Node.js, JavaScript/TypeScript, GraphQL
Good to Have: Express.js
Exp: 5 to 9 years

  • Extensive experience working with Express.js and TypeScript.
  • Developing Azure Serverless functions using Node.js
  • Working knowledge on GraphQL and integrate with Express.js middleware (Azure Functions)
  • Consuming APIs to interact with other applications using GraphQL and Restful web services.
  • Azure Service Bus (ASB), Pub/Sub model of message communication and Message handling life-cycle (Time-To-Live, Size, Locking, DeadLetterQueue, Sessions, Duplicate Detection, etc)
  • Build & DevOps process
  • Experience with headless commerce engine or CMS an advantage
  • General eCommerce experience preferred.
  • Good understanding of algorithms and data structures
  • Should be good in communication and presentation skills
  • Should be a self-starter with high initiative, team player, with problem solving abilities. 

This will close in 0 seconds