Skip to content

Martini Email Functions

Overview

The Email class in Martini offers a range of functions for sending and reading emails. This section provides detailed instructions on how to utilize these functions in your services.

Accessing and Implementing Email Functions

Accessing Functions

To access the Email functions: 1. Navigate to the 'functions node' in the Martini navigator. 2. Open the 'email' folder to view the list of available functions.

Implementing Functions

Integrate Email functions into your service by: - Dragging and dropping them into the service editor. - Using content assist, activated by pressing the '.' (full stop) key, and typing "email." to list available email functions.

Configuring Email Functions

Protocol

Choose between SMTP or SMTPS protocol based on your email client. For custom protocols, use Groovy in the set expression wizard to specify a different value.

Authentication

Provide the login and password for the email client. Use an app password for enhanced security where applicable.

Server Settings

  • Select from pre-configured server options or
  • Configure a custom SMTP server by choosing Groovy in the set expression wizard and defining your server as a string.

Port

Specify the port for your SMTP server.

Email Properties

  • From: The sender's name as it will appear to the recipient, which can differ from the sending email address.
  • To: Add recipient email address(es). For multiple recipients, use an array of addresses.
  • CC/BCC: Optional fields for additional recipients. Use arrays for multiple addresses.
  • Subject: The subject line of the email.
  • is HTML: A boolean to indicate if the email body is HTML (true) or plain text (false).
  • Body: The content of the email.
  • Attachments: Option to add file attachments.
  • Headers: Advanced option for setting custom email headers.

Testing Email Functions

To ensure the correct functionality of the email service: 1. Send a test email to a specified inbox. 2. Confirm the email's arrival and verify its contents, including the subject, body, and attachments.