SlideShare a Scribd company logo
Mule with Velocity
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/MarkingVelocityMessageTransformer.jav
a
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 velocity

More Related Content

What's hot

Deploying and running mule standalone
Deploying and running mule standaloneDeploying and running mule standalone
Deploying and running mule standalone
mdfkhan625
 
Sending mail with attachment
Sending mail with attachmentSending mail with attachment
Sending mail with attachment
Anirban Sen Chowdhary
 
Idempotent filter in Mule
Idempotent filter in MuleIdempotent filter in Mule
Idempotent filter in Mule
F K
 
Idempotent filter in mule
Idempotent filter in muleIdempotent filter in mule
Idempotent filter in mule
Mohammed246
 
Deploying and running in mule standalone
Deploying and running in mule standaloneDeploying and running in mule standalone
Deploying and running in mule standalone
Anirban Sen Chowdhary
 
Example mule
Example muleExample mule
Example mule
JavierMarRas
 
Mule management console installation with Tomcat
Mule management console installation with TomcatMule management console installation with Tomcat
Mule management console installation with Tomcat
Sudha Ch
 
My journey and learnings using mule esb part 1
My journey and learnings using mule esb part 1My journey and learnings using mule esb part 1
My journey and learnings using mule esb part 1
Alex Fernandez
 
Cloud hub with mule
Cloud hub with muleCloud hub with mule
Cloud hub with mule
Son Nguyen
 
Using ajax in mule
Using ajax in muleUsing ajax in mule
Using ajax in mule
Anirban Sen Chowdhary
 
Expose web service
Expose web serviceExpose web service
Expose web service
Son Nguyen
 
Anypoint lessons
Anypoint lessonsAnypoint lessons
Anypoint lessons
Dwight Cavalcanti
 
Using maven with mule
Using maven with muleUsing maven with mule
Using maven with mule
Sindhu VL
 
Mule ESB - How to convert from Xml to Json in 5 minutes
Mule ESB - How to convert from Xml to Json in 5 minutesMule ESB - How to convert from Xml to Json in 5 minutes
Mule ESB - How to convert from Xml to Json in 5 minutes
Gennaro Spagnoli
 
Integrate to retrieve data microsoft azure
Integrate to retrieve data microsoft azureIntegrate to retrieve data microsoft azure
Integrate to retrieve data microsoft azure
Son Nguyen
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
F K
 
Mule with salesforce push topic notification copy
Mule with salesforce push topic notification   copyMule with salesforce push topic notification   copy
Mule with salesforce push topic notification copy
Sanjeet Pandey
 

What's hot (17)

Deploying and running mule standalone
Deploying and running mule standaloneDeploying and running mule standalone
Deploying and running mule standalone
 
Sending mail with attachment
Sending mail with attachmentSending mail with attachment
Sending mail with attachment
 
Idempotent filter in Mule
Idempotent filter in MuleIdempotent filter in Mule
Idempotent filter in Mule
 
Idempotent filter in mule
Idempotent filter in muleIdempotent filter in mule
Idempotent filter in mule
 
Deploying and running in mule standalone
Deploying and running in mule standaloneDeploying and running in mule standalone
Deploying and running in mule standalone
 
Example mule
Example muleExample mule
Example mule
 
Mule management console installation with Tomcat
Mule management console installation with TomcatMule management console installation with Tomcat
Mule management console installation with Tomcat
 
My journey and learnings using mule esb part 1
My journey and learnings using mule esb part 1My journey and learnings using mule esb part 1
My journey and learnings using mule esb part 1
 
Cloud hub with mule
Cloud hub with muleCloud hub with mule
Cloud hub with mule
 
Using ajax in mule
Using ajax in muleUsing ajax in mule
Using ajax in mule
 
Expose web service
Expose web serviceExpose web service
Expose web service
 
Anypoint lessons
Anypoint lessonsAnypoint lessons
Anypoint lessons
 
Using maven with mule
Using maven with muleUsing maven with mule
Using maven with mule
 
Mule ESB - How to convert from Xml to Json in 5 minutes
Mule ESB - How to convert from Xml to Json in 5 minutesMule ESB - How to convert from Xml to Json in 5 minutes
Mule ESB - How to convert from Xml to Json in 5 minutes
 
Integrate to retrieve data microsoft azure
Integrate to retrieve data microsoft azureIntegrate to retrieve data microsoft azure
Integrate to retrieve data microsoft azure
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
 
Mule with salesforce push topic notification copy
Mule with salesforce push topic notification   copyMule with salesforce push topic notification   copy
Mule with salesforce push topic notification copy
 

Viewers also liked

Introduction to mule esb
Introduction to mule esbIntroduction to mule esb
Introduction to mule esb
Praneethchampion
 
Creating dynamic json in mule
Creating dynamic json in muleCreating dynamic json in mule
Creating dynamic json in mule
Praneethchampion
 
How to use expression filter
How to use expression filter How to use expression filter
How to use expression filter
Praneethchampion
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mule
Praneethchampion
 
xslt in mule
xslt in mulexslt in mule
xslt in mule
Praneethchampion
 
Groovy in Mule
Groovy in MuleGroovy in Mule
Groovy in Mule
Praneethchampion
 
Mule technology
Mule technologyMule technology
Mule technology
Praneethchampion
 
Mule anypoint exchange
Mule anypoint exchangeMule anypoint exchange
Mule anypoint exchange
Praneethchampion
 
Mule real-world-old
Mule real-world-oldMule real-world-old
Mule real-world-old
Praneethchampion
 
Damaging damzelz' no.1
Damaging damzelz' no.1Damaging damzelz' no.1
Damaging damzelz' no.1
tailgunnerx1
 
Documantation with mule
Documantation with mule Documantation with mule
Documantation with mule
Praneethchampion
 
Anypoint data gateway
Anypoint data gatewayAnypoint data gateway
Anypoint data gateway
Praneethchampion
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
Praneethchampion
 
Mule google connectors
Mule google connectorsMule google connectors
Mule google connectors
Praneethchampion
 
Mule security-jaas
Mule security-jaasMule security-jaas
Mule security-jaas
Praneethchampion
 
Soap request in mule
Soap request in mule Soap request in mule
Soap request in mule
Praneethchampion
 
Mule batch processing
Mule batch processingMule batch processing
Mule batch processing
Praneethchampion
 
Mule oracle connectors
Mule oracle connectorsMule oracle connectors
Mule oracle connectors
Praneethchampion
 
Mmc rest api user groups
Mmc rest api user groups Mmc rest api user groups
Mmc rest api user groups
Praneethchampion
 
Mule soap
Mule soapMule soap
Mule soap
Praneethchampion
 

Viewers also liked (20)

Introduction to mule esb
Introduction to mule esbIntroduction to mule esb
Introduction to mule esb
 
Creating dynamic json in mule
Creating dynamic json in muleCreating dynamic json in mule
Creating dynamic json in mule
 
How to use expression filter
How to use expression filter How to use expression filter
How to use expression filter
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mule
 
xslt in mule
xslt in mulexslt in mule
xslt in mule
 
Groovy in Mule
Groovy in MuleGroovy in Mule
Groovy in Mule
 
Mule technology
Mule technologyMule technology
Mule technology
 
Mule anypoint exchange
Mule anypoint exchangeMule anypoint exchange
Mule anypoint exchange
 
Mule real-world-old
Mule real-world-oldMule real-world-old
Mule real-world-old
 
Damaging damzelz' no.1
Damaging damzelz' no.1Damaging damzelz' no.1
Damaging damzelz' no.1
 
Documantation with mule
Documantation with mule Documantation with mule
Documantation with mule
 
Anypoint data gateway
Anypoint data gatewayAnypoint data gateway
Anypoint data gateway
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Mule google connectors
Mule google connectorsMule google connectors
Mule google connectors
 
Mule security-jaas
Mule security-jaasMule security-jaas
Mule security-jaas
 
Soap request in mule
Soap request in mule Soap request in mule
Soap request in mule
 
Mule batch processing
Mule batch processingMule batch processing
Mule batch processing
 
Mule oracle connectors
Mule oracle connectorsMule oracle connectors
Mule oracle connectors
 
Mmc rest api user groups
Mmc rest api user groups Mmc rest api user groups
Mmc rest api user groups
 
Mule soap
Mule soapMule soap
Mule soap
 

Similar to Mule velocity

Dynamic file attribute
Dynamic file attributeDynamic file attribute
Dynamic file attribute
Anirban Sen Chowdhary
 
Email configuration in mule esb
Email configuration in mule esbEmail configuration in mule esb
Email configuration in mule esb
Vamsi Krishna
 
What is html xml and xhtml
What is html xml and xhtmlWhat is html xml and xhtml
What is html xml and xhtml
FkdiMl
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
Mohammed246
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule
Khasim Saheb
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule
mdfkhan625
 
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 mule
F K
 
Automatic documentation with mule
Automatic documentation with mule Automatic documentation with mule
Automatic documentation with mule
javeed_mhd
 
Joomla tempates talk
Joomla tempates talkJoomla tempates talk
Joomla tempates talk
Chad Windnagle
 
Automatic documantation with mule
Automatic documantation with muleAutomatic documantation with mule
Automatic documantation with mule
Sunil Komarapu
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
Hasan Syed
 
Presentation 1 [autosaved]
Presentation 1 [autosaved]Presentation 1 [autosaved]
Presentation 1 [autosaved]
AbdulrahmaanDhagacad
 
Mule connectors-session1
Mule connectors-session1Mule connectors-session1
Mule connectors-session1
Vishnukanth Rachineni
 
Trigger Emails BigD17
Trigger Emails BigD17Trigger Emails BigD17
Trigger Emails BigD17
Susan McKenzie
 
Automatic documentation with mule
Automatic documentation with mule Automatic documentation with mule
Automatic documentation with mule
Anirban Sen Chowdhary
 
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esb
Anand kalla
 
Emberjs and ASP.NET
Emberjs and ASP.NETEmberjs and ASP.NET
Emberjs and ASP.NET
Mike Melusky
 
Mule connectors-part 1
Mule connectors-part 1Mule connectors-part 1
Mule connectors-part 1
VirtusaPolaris
 
Mulesoft - Documentation (Automation)
Mulesoft - Documentation (Automation)Mulesoft - Documentation (Automation)
Mulesoft - Documentation (Automation)
Vamsi Krishna
 

Similar to Mule velocity (20)

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
 
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 muleAutomatic documentation with mule
Automatic documentation with mule
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule
 
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
 
Joomla tempates talk
Joomla tempates talkJoomla tempates talk
Joomla tempates talk
 
Automatic documantation with mule
Automatic documantation with muleAutomatic documantation with mule
Automatic documantation with mule
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
 
Presentation 1 [autosaved]
Presentation 1 [autosaved]Presentation 1 [autosaved]
Presentation 1 [autosaved]
 
Mule connectors-session1
Mule connectors-session1Mule connectors-session1
Mule connectors-session1
 
Trigger Emails BigD17
Trigger Emails BigD17Trigger Emails BigD17
Trigger Emails BigD17
 
Automatic documentation with mule
Automatic documentation with mule Automatic documentation with mule
Automatic documentation with mule
 
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esb
 
Emberjs and ASP.NET
Emberjs and ASP.NETEmberjs and ASP.NET
Emberjs and ASP.NET
 
Mule connectors-part 1
Mule connectors-part 1Mule connectors-part 1
Mule connectors-part 1
 
Mulesoft - Documentation (Automation)
Mulesoft - Documentation (Automation)Mulesoft - Documentation (Automation)
Mulesoft - Documentation (Automation)
 

More from Praneethchampion

Mule execution
Mule executionMule execution
Mule execution
Praneethchampion
 
Mule soa
Mule soaMule soa
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripe
Praneethchampion
 
Dataweave
Dataweave Dataweave
Dataweave
Praneethchampion
 
Mule for each scope header collection
Mule for each scope header collectionMule for each scope header collection
Mule for each scope header collection
Praneethchampion
 
Mmc
Mmc Mmc
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layer
Praneethchampion
 
Mule security
Mule securityMule security
Mule security
Praneethchampion
 
Webservice vm in mule
Webservice vm in muleWebservice vm in mule
Webservice vm in mule
Praneethchampion
 
Scatter gather flow in mule
Scatter gather flow in muleScatter gather flow in mule
Scatter gather flow in mule
Praneethchampion
 
Mule rabbitmq
Mule rabbitmqMule rabbitmq
Mule rabbitmq
Praneethchampion
 
Mule quartz
Mule quartz Mule quartz
Mule quartz
Praneethchampion
 
Mule drools
Mule drools Mule drools
Mule drools
Praneethchampion
 
Mule esb DataWeave
Mule esb DataWeaveMule esb DataWeave
Mule esb DataWeave
Praneethchampion
 
Idempotent filter in mule
Idempotent filter in muleIdempotent filter in mule
Idempotent filter in mule
Praneethchampion
 

More from Praneethchampion (15)

Mule execution
Mule executionMule execution
Mule execution
 
Mule soa
Mule soaMule soa
Mule soa
 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripe
 
Dataweave
Dataweave Dataweave
Dataweave
 
Mule for each scope header collection
Mule for each scope header collectionMule for each scope header collection
Mule for each scope header collection
 
Mmc
Mmc Mmc
Mmc
 
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layer
 
Mule security
Mule securityMule security
Mule security
 
Webservice vm in mule
Webservice vm in muleWebservice vm in mule
Webservice vm in mule
 
Scatter gather flow in mule
Scatter gather flow in muleScatter gather flow in mule
Scatter gather flow in mule
 
Mule rabbitmq
Mule rabbitmqMule rabbitmq
Mule rabbitmq
 
Mule quartz
Mule quartz Mule quartz
Mule quartz
 
Mule drools
Mule drools Mule drools
Mule drools
 
Mule esb DataWeave
Mule esb DataWeaveMule esb DataWeave
Mule esb DataWeave
 
Idempotent filter in mule
Idempotent filter in muleIdempotent filter in mule
Idempotent filter in mule
 

Recently uploaded

Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 

Recently uploaded (20)

Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 

Mule velocity

  • 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/MarkingVelocityMessageTransformer.jav a 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 