The SMC Gateway is capable of sending (and receiving) email, and you will need to configure an email server, something that can be difficult to arrange with your end user.
Using public services such as Yahoo, Google and the like is not recommended as these providers may consider this type of usage outside of their terms of usage. Therefore we recommend using a commercial email service such as mailgun which is commercially supported, and provides you with the ability to create multiple mail accounts as well as being able to monitor via a web portal a log of email sent, and delivery status.
Creating a mailgun account
Creating a mailgun account is free, and you are able to send up to 10,000 emails per month at no cost. To get started goto https://mailgun.com/signup and follow the instructions to create an account.
Setting up the domain/from address
You will need to configure a domain name to use for the ‘from’ address.
You may want to use a subdomain of your company’s domain such as alerts.smc-gateway.net where smc-gateway.net is your domain name, and for each end user you can configure a from address such as email@example.com
In order to configure the domain mailgun will display a screen with instructions, and you should pass these onto the company/person who manages your website/domain name.
Setting up a client to use your mailgun account
Your mailgun account can be used with multiple end users, and each end user can have an unique from address and associated password – this means you are able to withdraw the use of the service for an individual end user without effecting other end users.
- Login to your mailgun account
- Click on the Domains menu
- Click on your domain name (i.e. not the default sandbox domain)
- Click on the ‘Manage SMTP credentials’ link to the right of the Domain Information/Default Password item
- Click on the ‘New SMTP Credential’ button
- Enter a end user specific login and new password and click ‘Create Credential’
Configuring the SMC Gateway to use mailgun
Your SMC Gateway can now be configured to use the a mailgun account like so:
- Login into your SMC Gateway
- Click on the Workflow editor link
- Drag and drop an e-mail node onto the workflow
- Double click the new e-mail node
- Enter the settings as below:
- To: is the address the emails are being sent too. You can enter multiple addresses with a comma between them
- Server: smtp.mailgun.org
- Port: 465
- Userid: Full email address on the mailgun account e.g. firstname.lastname@example.org
- Password: As entered when you created the mailgun SMTP credential
- Name: Optional name that appears only on the workflow editor
To test the ‘e-mail’ node drag and drop an ‘inject’ node and connect them together. Click deploy and then click on the ‘inject’ node button to send an email. The debug log should not display any messages, unless there’s an error!
Setting the e-mail subject
By default the SMC Gateway e-mail node will send the message payload as the body of the email, and the subject line will be blank. You can set the subject line using a ‘template’ node with the Property value set to ‘topic’, and the actual subject line being the template text.