SlideShare ist ein Scribd-Unternehmen logo
1 von 13
By Anirban Sen Chowdhary
Have you ever wondered how to send an email through Mule Esb with a well
designed format and where you can pick up some dynamic values from properties
file and designed your email from a pre defined template and design in a colourful
format with colourful text and logos ??
Yes you can design that email for your customers, subscribers or anybody else you
wish to.
Mule can trigger mail with a pre defined template where you can design the body of
your email with different HTML tags and put various texts, text colour, images,
logos in your email body and also pic some dynamic values in it.
To design the template you only need a minimum knowledge of HTML tags and can
design the template easily.
Yes .. I am talking about Mule with Velocity template for your mail ..
Before we start, we will see what is Velocity template.
Velocity is an open source templating tool developed by an international volunteer
community and hosted by the Apache Software Foundation's Jakarta Project.
You can find more information on it here :-
https://velocity.apache.org/engine/releases/velocity-1.5/user-
guide.html#what_is_velocity
To integrate Velocity template with Mule you will find good examples over net.
There is already example by great David Dossot of using Velocity transformer class
here :- https://muleinaction.googlecode.com/svn-history/r490/branches/mule-
3/chapter05/velocity-
transformer/src/main/java/com/muleinaction/transformer/MarkingVelocityMessag
eTransformer.java
I have just modified the code and reused it as per my requirement
So, we first need a Velocity transformer Java class as following :-
This class will set the email payload, map the external dynamic values with the email
So, we will also have external values from properties files as following :-
These values from properties file will make the Velocity template dynamic as it will pick the
values form here and set to the mail body .. Values like customer or subscriber name can
be defined here dynamically
So, we will also have external values from properties files as following :-
Here you can see, file is picked up by the flow and the file content is set as message body of the
email along with other dynamic values from external properties file
And finally our Velocity template is as following :-
Here you can see the HTML codes like <p/>, <img/> <html> tags are used to design the email
content .. Also, values like $FileName, $Subscriber are picked from properties file.
Also $payload is the content from the inbound file and it is appended with this mail body.
Isn’t these are dynamic !!!!
Let’s test our application now.. Let’s place a file in the inbound folder with a content say
This message is from a file !!! And start our application … we will see the console as following
:-
You can see the email has been send successfully and the email body as a preview in the log ..
Now let’s check our actual email
Here is the mail we received from Mule with Velocity template and here what we got :-
You can see different text formats, bold texts , images , logos etc that was designed in
Velocity template with HTML codes. Also, you can see the values are picked from
properties file
So, here you can see how to set a email body colourful and dynamic using Mule and
Velocity template !!!….
In my next slide I will bring some other techniques in Mule implementation .
Hope you have enjoyed this simpler version.
Keep sharing your knowledge and let our Mule community grow 
Mule with velocity

Weitere ähnliche Inhalte

Was ist angesagt?

Idempotent filter in Mule
Idempotent filter in MuleIdempotent filter in Mule
Idempotent filter in MuleF K
 
Scatter and gather in mule
Scatter and gather in muleScatter and gather in mule
Scatter and gather in muleRajkattamuri
 
Mule esb - How to connect to a MySql Database in 5 minutes
Mule esb - How to connect to a MySql Database in 5 minutesMule esb - How to connect to a MySql Database in 5 minutes
Mule esb - How to connect to a MySql Database in 5 minutesGennaro Spagnoli
 
Mule with drools
Mule with droolsMule with drools
Mule with droolsF K
 
Demo on Mule ESB Facebook Connector
Demo on Mule ESB Facebook ConnectorDemo on Mule ESB Facebook Connector
Demo on Mule ESB Facebook ConnectorRupesh Sinha
 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in MuleKhasim Saheb
 
Mule with drools
Mule with droolsMule with drools
Mule with droolsKhan625
 
Mulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other ApplicationsMulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other Applicationskumar gaurav
 
Deploy apps in standalone with maven
Deploy apps in standalone with mavenDeploy apps in standalone with maven
Deploy apps in standalone with mavenAnirban Sen Chowdhary
 

Was ist angesagt? (13)

Idempotent filter in Mule
Idempotent filter in MuleIdempotent filter in Mule
Idempotent filter in Mule
 
Scatter and gather in mule
Scatter and gather in muleScatter and gather in mule
Scatter and gather in mule
 
Mule esb - How to connect to a MySql Database in 5 minutes
Mule esb - How to connect to a MySql Database in 5 minutesMule esb - How to connect to a MySql Database in 5 minutes
Mule esb - How to connect to a MySql Database in 5 minutes
 
Web application with mule
Web application with muleWeb application with mule
Web application with mule
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
 
Demo on Mule ESB Facebook Connector
Demo on Mule ESB Facebook ConnectorDemo on Mule ESB Facebook Connector
Demo on Mule ESB Facebook Connector
 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in Mule
 
Mule
MuleMule
Mule
 
Mule soap
Mule soapMule soap
Mule soap
 
Using ajax in mule
Using ajax in muleUsing ajax in mule
Using ajax in mule
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
 
Mulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other ApplicationsMulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other Applications
 
Deploy apps in standalone with maven
Deploy apps in standalone with mavenDeploy apps in standalone with maven
Deploy apps in standalone with maven
 

Ähnlich wie Mule with velocity

Mule with velocity
Mule with velocityMule with velocity
Mule with velocityKhan625
 
Mule with velocity
Mule with velocityMule with velocity
Mule with velocityRajkattamuri
 
Mule with velocity
Mule with velocity Mule with velocity
Mule with velocity mdfkhan625
 
Mule with velocity
Mule with velocity Mule with velocity
Mule with velocity javeed_mhd
 
Mule with velocity
Mule with velocityMule with velocity
Mule with velocityHasan Syed
 
Email configuration in mule esb
Email configuration in mule esbEmail configuration in mule esb
Email configuration in mule esbVamsi Krishna
 
What is html xml and xhtml
What is html xml and xhtmlWhat is html xml and xhtml
What is html xml and xhtmlFkdiMl
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule AbdulImrankhan7
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with muleF K
 
Automatic documentation with mule
Automatic documentation with mule Automatic documentation with mule
Automatic documentation with mule javeed_mhd
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule mdfkhan625
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with muleMohammed246
 

Ähnlich wie Mule with velocity (20)

Mule with velocity
Mule with velocityMule with velocity
Mule with velocity
 
Mule with velocity
Mule with velocity Mule with velocity
Mule with velocity
 
Mule with velocity
Mule with velocityMule with velocity
Mule with velocity
 
Mule with velocity
Mule with velocity Mule with velocity
Mule with velocity
 
Mule with velocity
Mule with velocity Mule with velocity
Mule with velocity
 
Mule with velocity
Mule with velocityMule with velocity
Mule with velocity
 
Mule with velocity
Mule with velocityMule with velocity
Mule with velocity
 
Dynamic file attribute
Dynamic file attributeDynamic file attribute
Dynamic file attribute
 
Email configuration in mule esb
Email configuration in mule esbEmail configuration in mule esb
Email configuration in mule esb
 
Trigger Emails BigD17
Trigger Emails BigD17Trigger Emails BigD17
Trigger Emails BigD17
 
Joomla tempates talk
Joomla tempates talkJoomla tempates talk
Joomla tempates talk
 
What is html xml and xhtml
What is html xml and xhtmlWhat is html xml and xhtml
What is html xml and xhtml
 
Automatic documentation with mule
Automatic documentation with mule Automatic documentation with mule
Automatic documentation with mule
 
Presentation 1 [autosaved]
Presentation 1 [autosaved]Presentation 1 [autosaved]
Presentation 1 [autosaved]
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
 
Automatic documentation with mule
Automatic documentation with mule Automatic documentation with mule
Automatic documentation with mule
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule
 
Documantation with mule
Documantation with mule Documantation with mule
Documantation with mule
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
 

Mehr von Anirban Sen Chowdhary

Overview in ringcentral digital line
Overview in ringcentral digital lineOverview in ringcentral digital line
Overview in ringcentral digital lineAnirban Sen Chowdhary
 
RingCentral application development overview
RingCentral application development overviewRingCentral application development overview
RingCentral application development overviewAnirban Sen Chowdhary
 
Overview on ring central errors part 4
Overview on ring central errors part 4Overview on ring central errors part 4
Overview on ring central errors part 4Anirban Sen Chowdhary
 
Setting up your ring central sandbox in steps
Setting up your ring central sandbox in stepsSetting up your ring central sandbox in steps
Setting up your ring central sandbox in stepsAnirban Sen Chowdhary
 
Overview on ring central errors: part 2
Overview on ring central errors: part 2Overview on ring central errors: part 2
Overview on ring central errors: part 2Anirban Sen Chowdhary
 
Call recording overview ring central
Call recording overview  ring centralCall recording overview  ring central
Call recording overview ring centralAnirban Sen Chowdhary
 
Ring central engaging with amazon alexa
Ring central engaging with amazon alexaRing central engaging with amazon alexa
Ring central engaging with amazon alexaAnirban Sen Chowdhary
 
How ring central sdk changing the game
How ring central sdk changing the gameHow ring central sdk changing the game
How ring central sdk changing the gameAnirban Sen Chowdhary
 
When ring central connect salesforce
When ring central connect salesforceWhen ring central connect salesforce
When ring central connect salesforceAnirban Sen Chowdhary
 
Ring central connecting salesforce overview
Ring central connecting salesforce overviewRing central connecting salesforce overview
Ring central connecting salesforce overviewAnirban Sen Chowdhary
 
Ring central call logs overview (part 2)
Ring central call logs overview (part 2)Ring central call logs overview (part 2)
Ring central call logs overview (part 2)Anirban Sen Chowdhary
 

Mehr von Anirban Sen Chowdhary (20)

Change the game with Game changer
Change the game with Game changerChange the game with Game changer
Change the game with Game changer
 
Ring central desktop app overview
Ring central desktop app overviewRing central desktop app overview
Ring central desktop app overview
 
Overview in ringcentral digital line
Overview in ringcentral digital lineOverview in ringcentral digital line
Overview in ringcentral digital line
 
Some basics with ring central
Some basics with ring centralSome basics with ring central
Some basics with ring central
 
Ring central and python
Ring central and pythonRing central and python
Ring central and python
 
RingCentral application development overview
RingCentral application development overviewRingCentral application development overview
RingCentral application development overview
 
Cloze connect ringcentral
Cloze connect ringcentralCloze connect ringcentral
Cloze connect ringcentral
 
Overview on ring central errors part 4
Overview on ring central errors part 4Overview on ring central errors part 4
Overview on ring central errors part 4
 
Setting up your ring central sandbox in steps
Setting up your ring central sandbox in stepsSetting up your ring central sandbox in steps
Setting up your ring central sandbox in steps
 
Overview on ring central errors: part 2
Overview on ring central errors: part 2Overview on ring central errors: part 2
Overview on ring central errors: part 2
 
Overview on ring central errors
Overview on ring central errorsOverview on ring central errors
Overview on ring central errors
 
Call recording overview ring central
Call recording overview  ring centralCall recording overview  ring central
Call recording overview ring central
 
Ring central engaging with amazon alexa
Ring central engaging with amazon alexaRing central engaging with amazon alexa
Ring central engaging with amazon alexa
 
How ring central sdk changing the game
How ring central sdk changing the gameHow ring central sdk changing the game
How ring central sdk changing the game
 
When ring central connect salesforce
When ring central connect salesforceWhen ring central connect salesforce
When ring central connect salesforce
 
Mule 4 connecting ring central
Mule 4 connecting ring centralMule 4 connecting ring central
Mule 4 connecting ring central
 
Ring central sdk
Ring central sdkRing central sdk
Ring central sdk
 
Ring central with okta
Ring central with oktaRing central with okta
Ring central with okta
 
Ring central connecting salesforce overview
Ring central connecting salesforce overviewRing central connecting salesforce overview
Ring central connecting salesforce overview
 
Ring central call logs overview (part 2)
Ring central call logs overview (part 2)Ring central call logs overview (part 2)
Ring central call logs overview (part 2)
 

Kürzlich hochgeladen

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Kürzlich hochgeladen (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

Mule with velocity

  • 1. By Anirban Sen Chowdhary
  • 2. Have you ever wondered how to send an email through Mule Esb with a well designed format and where you can pick up some dynamic values from properties file and designed your email from a pre defined template and design in a colourful format with colourful text and logos ?? Yes you can design that email for your customers, subscribers or anybody else you wish to. Mule can trigger mail with a pre defined template where you can design the body of your email with different HTML tags and put various texts, text colour, images, logos in your email body and also pic some dynamic values in it. To design the template you only need a minimum knowledge of HTML tags and can design the template easily. Yes .. I am talking about Mule with Velocity template for your mail ..
  • 3.
  • 4. Before we start, we will see what is Velocity template. Velocity is an open source templating tool developed by an international volunteer community and hosted by the Apache Software Foundation's Jakarta Project. You can find more information on it here :- https://velocity.apache.org/engine/releases/velocity-1.5/user- guide.html#what_is_velocity To integrate Velocity template with Mule you will find good examples over net. There is already example by great David Dossot of using Velocity transformer class here :- https://muleinaction.googlecode.com/svn-history/r490/branches/mule- 3/chapter05/velocity- transformer/src/main/java/com/muleinaction/transformer/MarkingVelocityMessag eTransformer.java I have just modified the code and reused it as per my requirement
  • 5. So, we first need a Velocity transformer Java class as following :- This class will set the email payload, map the external dynamic values with the email
  • 6. So, we will also have external values from properties files as following :- These values from properties file will make the Velocity template dynamic as it will pick the values form here and set to the mail body .. Values like customer or subscriber name can be defined here dynamically
  • 7. So, we will also have external values from properties files as following :- Here you can see, file is picked up by the flow and the file content is set as message body of the email along with other dynamic values from external properties file
  • 8. And finally our Velocity template is as following :- Here you can see the HTML codes like <p/>, <img/> <html> tags are used to design the email content .. Also, values like $FileName, $Subscriber are picked from properties file. Also $payload is the content from the inbound file and it is appended with this mail body. Isn’t these are dynamic !!!!
  • 9. Let’s test our application now.. Let’s place a file in the inbound folder with a content say This message is from a file !!! And start our application … we will see the console as following :- You can see the email has been send successfully and the email body as a preview in the log .. Now let’s check our actual email
  • 10. Here is the mail we received from Mule with Velocity template and here what we got :- You can see different text formats, bold texts , images , logos etc that was designed in Velocity template with HTML codes. Also, you can see the values are picked from properties file
  • 11. So, here you can see how to set a email body colourful and dynamic using Mule and Velocity template !!!….
  • 12. In my next slide I will bring some other techniques in Mule implementation . Hope you have enjoyed this simpler version. Keep sharing your knowledge and let our Mule community grow 