Email & SMTP
Para has a dedicated API endpoint for sending emails at /v1/_emails.
It allows you to send transactional emails with a direct API request to /v1/_emails, authenticated by API key or request signature.
For attaching files, add the file field - it must have a value encoded as Data URI.
Example JSON payload with attachment:
{ "name": "Jane Doe", "subject": "Attached message", "message": "See attached.", "plaintextOnly": true, "markdownEnabled": false, "file": "data:text/plain;base64,SGVsbG8gd29ybGQ="}Formatting rules
Message rendering is resolved in this order:
- If
plaintextOnlyistrue, HTML is stripped frommessage. - Otherwise, if
markdownEnabledistrue, Markdown is converted to HTML. - Otherwise, the raw
messagevalue is used as-is.
For public forms, formatting flags come from the stored Form object and override any client-provided values.
Programmatic access to the Emailer instance
Section titled “Programmatic access to the Emailer instance”The Emailer interface has a simple API for sending email messages.
public interface Emailer { boolean sendEmail(List<String> emails, String subject, String body);}You can access the available emailer instance with:
There are several implementations of the Emailer class - one for JavaMail API and one using AWS SES to send emails (separate plugin).
Para uses the Emailer APi for email verification, password recovery emails and email notifications.
Set support_email to be the email address used by the system.
An example SMTP configuration for JavaMail:
para.emailer = "javamail"para.mail.host = "smtp.example.com"para.mail.port = 587para.mail.password = "password"para.mail.tls = truepara.mail.ssl = falseEmail templates can be loaded with:
Emailer.class.getClassLoader().getResourceAsStream("emails/template.html")Para supports basic variable substitutions through Mustache with Utils.compileMustache(data, template).
You can switch to a different Emailer implementation, e.g. Amazon SES, by loading the
para-email-ses plugin and setting
para.emailer = "AWSEmailer". Also comment out the para.mail.* properties as they are ignored.
AWS credentials are picked up from the environment, like the AWS_PROFILE env. variable.