examples Package: Parsing an HTML Template Using Velocity
examples package contains example services that collectively demonstrate how
to parse HTML templates using the
VelocityMethods one-liners that are exposed to Gloop.
In our example here, we would parse the HTML template and send it as an email using the
Please see the following articles for more information:
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
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
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,
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
Configure required package properties first
velocity.invoke.InvokeSendEmail.gloop, the following required
package properties must be set:
||Email to use for authentication|
||Password to use for authentication|
||The sender of the email|
||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.
velocity.invoke.InvokeSendEmail.gloop, you should receive a message to the email address you configured
in the package properties that looks like the image below.