Workflow gửi email
Smart Hosts require a command line script to send email, as they do not have a built-in mail client. A gmail account must be created and associated with the host; this will be the account that emails will be sent from.
Configuring Email on a Smart Host
The following instructions are used to set up mail access using a gmail.com account. This script is specific to gmail.com and should not be used to setup email for other email services.
NOTE: The specific steps and menu selections described below are based on the Google®/gmail software/web UI active at the time of writing, and may be subject to change at any time with no notice to Savant. If the steps below do not align with the options presented, note that the general requirements remain the same, and steps should be reasonably modified based on the current options presented to the user at the time.
On the SDE, launch Savant Application Manager (SAM).
Select the appropriate da Vinci release for the host and click Activate.
Open System Monitor from the right menu.
In an open System Scanner window, select the Savant Smart Host.
Click Terminal in the menu bar to open an ssh session with the selected host.
When prompted, enter the password for the host.
At the command prompt type: savantSetGmailAccount
Follow the instructions that appear in the dialog box.
Gmail may block the login from the Smart Host initially. Send a test email via the Host, either by completing the workflow configuration and running the workflow, or by executing the relevant command and arguments to send a test email directly from a terminal command prompt on the Host. IF the test email has not been sent after several minutes, follow the steps below:
Log into the Gmail.com account being used to send the email.
Navigate to the Security Settings of the account.
Approve the "unknown device" that has recently attempted to access the gmail account (this is the Smart Host).
Also in the Security Settings, change "Allow Less Secure Apps"to ON.
NOTE: Two-Factor authentication is not supported for use within the Savant System.
Creating an Email Workflow on a Smart Host
Open a configuration in Blueprint and Generate Services.
In the open View Services window, select a room in the Services For drop-down list.
Double-click the created workflow to open Automator.
In the open Automator window, search for "Run".
Drag the Run Shell Script action into the workflow.
Enter the following into Run Shell Script action based on the Smart Host model being used.
SVR-SMRTD-00 | SVR-SMRTD-10 Smart Host echo "Your Message" | mail -s "Email Subject" recipient@email.com -- -f senderAccount@gmail.com -F "Name of Sender"
SHC-2000-xx Smart Host | SHC-S2 Smart Host echo "Your Message" | /usr/local/bin/rpm/savantMail -s "Email Subject" -r recipient@email.com -f senderAccount@gmail.com -F "Name of Sender"
Substitute Field Values:
Save the workflow.
Re-generate services, save the Blueprint configuration, and upload to the Host.