Skip to content

Overview

Concepts and Principles

Development

Overview

IDEs

API Explorer

Releases

Release Notes

TORO Integrate

Coder Studio

Coder Cloud

Bug Reports

Search

Parsing an HTML Template Using Velocity

Introduction

The examples package contains sample services that collectively demonstrate how to parse HTML templates using the VelocityMethods one-liners that are exposed to Gloop. In particular, this example, we would parse the HTML template and send it as an email using the one-liners in EmailMethods.

Related articles

Please see the following articles for more information:

Try It!

Under the Coder Navigator, expand the examples package entry 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 to be 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 below 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.