Package africa.sendbyte.templates
Class Templates
java.lang.Object
africa.sendbyte.templates.Templates
The Templates resource: manage reusable server-side Handlebars/MJML templates and
preview their rendered output.
Obtain an instance via client.templates(). Every method has a blocking
form and an ...Async form returning a CompletableFuture. Send with a
saved template by passing its id or name as templateId on a send request.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(TemplateRequest request) Create a new template.createAsync(TemplateRequest request) Asynchronouscreate(TemplateRequest).voidPermanently delete a template.deleteAsync(String id) Asynchronousdelete(String).Retrieve a template by id, including its stored HTML and MJML source.Asynchronousget(String).list()List all templates in the project.Asynchronouslist().Render a previously saved template against a set of variables, without sending.previewAsync(String id, Map<String, Object> variables) Asynchronouspreview(String, Map).render(RenderRequest request) Render a template body with variables inline, without saving anything.renderAsync(RenderRequest request) Asynchronousrender(RenderRequest).update(String id, TemplateRequest request) Replace a template's definition, bumping its version.updateAsync(String id, TemplateRequest request) Asynchronousupdate(String, TemplateRequest).
-
Constructor Details
-
Templates
-
-
Method Details
-
create
Create a new template. Invalid Handlebars/MJML is rejected at save time. -
createAsync
Asynchronouscreate(TemplateRequest). -
get
Retrieve a template by id, including its stored HTML and MJML source. -
getAsync
Asynchronousget(String). -
list
List all templates in the project. -
listAsync
Asynchronouslist(). -
update
Replace a template's definition, bumping its version. Already-sent emails are unaffected. -
updateAsync
Asynchronousupdate(String, TemplateRequest). -
delete
Permanently delete a template. Future sends referencing it will fail withnot_found. -
deleteAsync
Asynchronousdelete(String). -
render
Render a template body with variables inline, without saving anything. -
renderAsync
Asynchronousrender(RenderRequest). -
preview
Render a previously saved template against a set of variables, without sending. -
previewAsync
Asynchronouspreview(String, Map).
-