Witty
Witty is the template engine for the HareScript language.
Witty integrates seamlessly into the HareScript language, fully supporting its data-centric approach to web scripting and helps eliminate common encoding and programming errors.
Witty API
- BLOB FUNCTION ApplyOverlayToPDF(BLOB inputpdf, BLOB overlaypdf)
Overlay one PDF on top of another
- BLOB FUNCTION ConcatenatePDFs(BLOB ARRAY pdfs)
Concatenate PDFs together
- MACRO EmbedWittyComponent(STRING component, RECORD data)
Runs an embedded component
- RECORD ARRAY FUNCTION ExportPDFToImages(BLOB inpdf)
Export each page of the PDF to an image
- RECORD FUNCTION GenerateBrowserScreenshot(STRING url, RECORD options)
Get a screenshot of a page
- RECORD FUNCTION GeneratePDF(RECORD data, RECORD options)
Generate a PDF from a witty record
- RECORD FUNCTION GeneratePDFFromFile(RECORD wrappedfile, RECORD options)
Generate a PDF from a file
- RECORD FUNCTION GeneratePDFFromURL(STRING link, RECORD options)
Generate a PDF from a URL
- RECORD FUNCTION GetEmailAutocorrection(STRING email)
Suggest improvement to given suggestion
- VARIANT FUNCTION GetWittyVariable(STRING variablename)
Get a variable using the witty's lookup rules
- BOOLEAN FUNCTION IsSupportedMailingType(STRING mimetype)
Checks if the type of mailing is supported by GenerateHTMLMail
- OBJECT FUNCTION LoadWittyLibrary(STRING name, STRING encoding)
- OBJECTTYPE MailAssetCacheBase
- OBJECT FUNCTION PrepareMailWitty(STRING mailwitty, RECORD options)
Set up a witty for mailing
- BOOLEAN FUNCTION QueueMail(STRING origin, STRING ARRAY receivers, STRING sender, RECORD ARRAY mimeheaders, RECORD toppart)
This function puts a message in the WebHare mail queue, and send it to the standard mail server
- INTEGER ARRAY FUNCTION QueueMailInWork(STRING origin, STRING ARRAY receivers, STRING sender, RECORD ARRAY mimeheaders, RECORD toppart, RECORD options)
This function puts a message in the WebHare mail queue in the current work, and send it to the standard mail server
- BOOLEAN FUNCTION QueueSimpleMail(STRING origin, STRING mailfrom, STRING ARRAY mailto, STRING ARRAY mailcc, STRING ARRAY mailbcc, STRING subject, STRING messagetext, RECORD ARRAY attachments, BOOLEAN text_is_html)
Simple mail send function
- MACRO RestructureEmailForCompatibility(OBJECT dom)
make changes to the DOM to increase compatibility with email clients such as Outlook
- OBJECTTYPE WittyException
Base class for Witty exceptions
- OBJECTTYPE WittyMailComposer
Email composer returned by PrepareMailWitty
- OBJECTTYPE WittyParseException
Exception throw when Witty parsing errors are found
- OBJECTTYPE WittyRuntimeException
Exception throw when a Witty runtime exception occurs
- OBJECTTYPE WittyTemplate
Contains a Witty template