SendEmail(file, template, receiver, subject, message) Last updated: 08. Mar 2023

API only function

Producses a file using the specified template (HTML, PDF etc) and sendes the output by email.

Parameters

Name Type Description
file string Absolute path to file.
template string Name of the template to use to generate this file's download.
receiver string (email) To addres for the email.
subject string Subject for the email.
message string Message for the email.

Returns

Returns true if successful otherwise an error message.

Example

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
// Generate a PDF and send it
docly.sendEmail(
    "somefile", 
    "Contract.html.pdf", 
    "test@docly.net", 
    "Contract for rental", 
    "Here is the signed contract attached. See you soon!");