Emailing
ApiOmat sends eMails automatically during several events. By default, all emails are sent as plain text, whereas the used SMTP server and some static content can be configured in detail. For more appealing and customized emailing, Mandrill can be used.
Plaintext Emailing
ApiOmat supports sending emails internally using an arbitray SMTP server. First of all, a valid SMTP server has to be configured in apiomat.yaml file using the following settings:
common:
emails:
# the email's sender address ("from") used to send admin emails
admin: admin@apiomat.com
# the support-email address (e.g. used as sender for "forgot password"-requests)
support: support@apiomat.com
# the noreply-email address
noreply: noreply@apiomat.com
# the message footer for emails if not sent over mandrill
footer:
# debug option to print verbose information during email sending
debug: true
# Hostname of the SMTP server
host: localhost
# Username if authentication on SMTP server is necessary
#user:
# Password if authentication on SMTP server is necessary
#password:
# Port of the SMTP server
port: 25
# TRUE if authentication is needed in SMTP server
useAuth: false
# TRUE if SSL connection should be used
useSsl: false
# TRUE if STARTTLS should be used
useStarttls: false
The admin, support and noreply keys are related to the sender displayed in the receiver's email. A footer can be set as a plain text string which will be attached to every email sent.
If the debug option is set to true, the ApiOmat logs will contain a lot of information about the sending process and eventual failure data.
All other settings are related to the SMTP server itself and may be queried from its administrator. An example to use an Office365 mail account may look like follows:
Host=smtp.office365.com
user=<OFFICE365_ACCOUNT_EMAIL>
password=<OFFICE365_ACCOUNT_PASSWOIRD>
port=
587
useAuth=
true
useStarttls=
true
Templated emailing using Mandrill
In contrast to plaintext emailing, the Mandrill emailing tool provides lots of features to design and customize all emails sent by ApiOmat. To enable Mandrill emailing, just set up the api key in apiomat.yaml:
yambas:
...
mandrillApiKey=3TW4CPxHVF2aW1234wn4hh
In your Mandrill account, go to Outbound -> Templates and add a new template for each of the events below using the exact template name in the table. Please fill out all Template Defaults, since ApiOmat won't send default values on its own.
You can use the merge tags stated in the table for each event in the mail text if you surround the tag with *| .. |* .
Events
New customer signup
Description |
Is sent when a new customer has signed up (for internal notification) |
Merge tags |
|
Template name |
aom-newcustomer |
Customer email verification
Description |
Is sent when a customer has confirmed their email address |
Merge tags |
|
Template name |
aom-confirm |
Customers email address validation reminder
Description |
Is sent each day after a customer signs up; stops when they click on the confirmation link. If not confirmed after ten days, the customer gets locked. |
Merge tags |
|
Template name |
aom-verifyemail |
Customer password reset
Description |
Is sent when a customer forgot their password |
Merge tags |
|
Template name |
aom-customerpasswordreset |
User password reset
Description |
Is sent when an app user forgot their password |
Merge tags |
|
Template name |
aom-userpasswordreset |
Application Upgrade order
Description |
Is sent when a new payment is created |
Merge tags |
|
Template name |
aom-order |
Application Downgrade warning
Description |
Is sent when payment ends in the next 2 days |
Merge tags |
|
Template name |
aom-downgradewarning |
Application Downgrade warning (voucher payment)
Description |
Is sent when vocher code gets invalid in the next 2 days |
Merge tags |
|
Template name |
aom-downgradewarningvoucher |
Application Downgrade
Description |
Is sent when payment was not extended (app is not paid anymore) |
Merge tags |
|
Template name |
aom-downgrade |
Application Downgrade (voucher payment)
Description |
Is sent when voucher was not extended (app is not paid anymore) |
Merge tags |
|
Template name |
aom-downgradevoucher |
Application Trial Reminder Message
Description |
Is sent when app will expire in a few days |
Merge tags |
|
Template name |
aom-trialreminder |
Application Trial Expiration Message
Description |
Is sent when the trial has been expired |
Merge tags |
|
Template name |
aom-trialexpired |