Skip to content

Home

Introduction

Development

IDEs

Services

API Explorer

Releases

Release notes

Martini Runtime

Martini Desktop

Martini Online

Feature requests

Bug reports

examples package: Parsing an HTML template using Velocity

The examples package contains services that collectively demonstrate how to parse HTML templates using one-liners from VelocityMethods. In particular, these services parse the HTML template and send it as an email using one-liners from EmailMethods.

Related articles

Please see the following articles for more information:

Try it!

Under the Navigator, expand the examples package and navigate to the code folder. Afterwards, look for the velocity package. This package contains the following files and directories, shown below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
examples
├── ...
└── code
    └── velocity
        ├── invoke
        │   └── InvokeSendEmail.gloop
        ├── model
        │   └── Person.model
        └── service
            └── SendEmail.gloop

The velocity.invoke.InvokeSendEmail.gloop service is the service that you should run to be able to parse the HTML template and send it as an email. Underneath the covers, it calls velocity.service.SendEmail.gloop, which does the actual job of parsing the template and sending the email. The call was only wrapped to make the code easier to understand. Basically, velocity.invoke.InvokeSendEmail.gloop is in charge of setting the arguments required by velocity.service.SendEmail.gloop to make the call.

The credentials used for sending the email and to whom it will be sent will depend on the configured package properties, which must be set before invoking velocity.invoke.InvokeSendEmail.gloop.

Configure required package properties first

Before invoking velocity.invoke.InvokeSendEmail.gloop, the following required package properties must be set:

Name Description
login Email to use for authentication
password Password to use for authentication
from The sender of the email
to The receiver of the email

Some of these properties are already filled-out but you can change their values and set them to whatever you would like.

After running velocity.invoke.InvokeSendEmail.gloop, you should receive a message in the email address you've configured in package.properties. It should look something like:

Rendered velocity template sent to the email your configured