SendForm(form, subject, [sendTo], [smtp], [subjectPrefix]) Last updated: 22. Oct 2024

API only function

Use this function to send a submitted form by email from an API function.

Parameters

Name Type Description
form object Object where each property is added as a row in the notification.
subject string Subject of email, prefixed with "FORM: " if subjectPrefix is not set or null.
sendTo (optional) email(s) One or multiple emails to send to (csv).
smtp (optional) string Path to a SMTP configuration file, where you can specify sender address etc.
subjectPrefix (optional) bool If subjectPrefix is not specified or null, the subject prefix "FORM: " used.

Returns

True if successful or throws an error if sending fails.

Example

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
let form = {
    "Message" : "This is just an example",
    "Link" : "https://docly.org"
}
docly.SendForm(form, "Contact form", "test@docly.net");