The app accepts the following parameters to send emails via Mailgun -
- "to" - email of the recipient
- "to_name" - name of the recipient
- "cc" - email of the cc'd recipient
- "cc_name" - name of the cc'd recipient
- "bcc" - email of the bcc'd recipient
- "bcc_name" - name of the bcc'd recipient
- "from" - email of the sender
- "from_name" - name of the sender
- "subject" - subject of the email
- "body" - body of the email
The data is persisted through sqlite.
Sinatra is used as it is a lightweight framework that is ideal for dealing with HTTP requests.
Some additional features that can be added are -
- Customizing the emails further by adding the ability to add attachments and tags, tracking opens and clicks, and setting a delivery time of up to three days (Mailgun's limit)
- Silently failing requests to Mailgun by reverting to another service such as Mandrill
- Increasing spec coverage for form validation and invalid parameters sent to Mailgun
- Allowing the sender to mark an email as 'important', upon which he/she is notified (via email) about click and open actions by the recipient
- Enabling sending emails to multiple recipients
- Adding support for HTML elements in the body
- Detecting spam (albeit a more involved task)
=========