E-mail delivery system
Clone or download
Latest commit 208ebbc Nov 6, 2018
Permalink
Failed to load latest commit information.
liquibase #40 attach/detach Sep 20, 2018
objects #47 better error Nov 6, 2018
public #2 logo Aug 29, 2018
test subscribe Nov 6, 2018
views typo Nov 6, 2018
.0pdd.yml #1 skeleton Aug 27, 2018
.gitattributes #1 skeleton Aug 27, 2018
.gitignore #40 broken link Oct 28, 2018
.pdd #1 skeleton Aug 27, 2018
.rubocop.yml #45 ruby 2.5.1 Oct 15, 2018
.rultor.yml #40 broken link Oct 28, 2018
.simplecov #45 ruby 2.5.1 Oct 15, 2018
.travis.yml #7 postgresql Aug 30, 2018
Gemfile #40 broken link Oct 28, 2018
Gemfile.lock subscribe Nov 6, 2018
LICENSE.txt
Procfile #1 skeleton Aug 27, 2018
README.md doc Nov 6, 2018
Rakefile #45 ruby 2.5.1 Oct 15, 2018
config.ru #45 ruby 2.5.1 Oct 15, 2018
cucumber.yml #1 skeleton Aug 27, 2018
deploy.sh #1 skeleton Aug 27, 2018
mailanes.rb #47 check first Nov 6, 2018
version.rb #45 ruby 2.5.1 Oct 15, 2018

README.md

EO principles respected here Managed by Zerocracy DevOps By Rultor.com We recommend RubyMine

Build Status PDD status Test Coverage Maintainability

It's an e-mail sending web app.

How to Configure?

There are few entities you can configure via simple YAML settings, including lists, lanes, campaigns, letters, and recipients.

List

title: My subscribers
notify:
  # Notify this email every time a new subscriber
  # is added to the list through the /subscribe URL
  email: yegor256@gmail.com
  # Notify in Telegram chat. You can get this number
  # just by starting a chat with https://t.me/mailanes_bot
  telegram: 136544085
  # You may ignore some notifications
  ignore:
    - subscribe
    - unsubscribe
    - add
    - comment
    - download
    - upload
    - bounce
# List of GitHub account who also have access to this list
# and can add recipients to it, via /add?list=ID URL.
friends:
  - yegor256
# If this is set to TRUE an email right after being added
# to this list will be de-activated in all other lists
exclusive: true

Lane

title: Monthly newsletters
# The FROM field of all letters to be sent from this
# Lane. This can be overwritten by each individual Letter.
from: Yegor Bugayenko <yegor256@gmail.com>
# The CC of the email to be sent
cc:
  - Yegor Bugayenko <yegor256@gmail.com>
# The BCC of the email to be sent
bcc:
  - Yegor Bugayenko <yegor256@gmail.com>
# The TO field of all emails to be sent, which
# you don't need to specify usually, since this
# address is taken from the recipient details, but sometimes
# you may need this.
to: Yegor Bugayenko <yegor256@gmail.com>
# SMTP parameters of the email sending server
smtp:
  host: email-smtp.us-east-1.amazonaws.com
  port: 587
  user: AKIAI1TIS4FF6UGJT3CQ
  password: ArPxO8gf56y02G8cKM80IpvMQve8Pss+L4+inJZ3UG3t
# Here you can specify the Telegram transport details, if
# some of your letters are going to be delivered via Telegram.
telegram:
  chat_id: 7389473289

Campaign

# The title of the campaign
title: Monthlty
# Stop the campaign at this date (it will be deactivated automatically)
until: 03-09-2018
# Maximum amount of emails to be sent per day
speed: 100
notify:
  # Notify in Telegram chat. You can get this number
  # just by starting a chat with https://t.me/mailanes_bot
  telegram: 136544085

Letter

# The title of the letter
title: Aug 2018
# The subject of all emails to be sent
subject: There are some great news, guys!
# The FROM field of all emails to be sent
from: Yegor Bugayenko <yegor256@gmail.com>
# The CC of the email to be sent
cc:
  - Yegor Bugayenko <yegor256@gmail.com>
# The BCC of the email to be sent
bcc:
  - Yegor Bugayenko <yegor256@gmail.com>
# The TO field of all emails to be sent, which
# you don't need to specify usually, since this
# address is taken from the recipient details, but sometimes
# you may need this.
to: Yegor Bugayenko <yegor256@gmail.com>
# When this Letter has to be deactivated
until: 03-09-2018
# For how many days/hours/minutes the campaign should
# not send out any letters after it sends this one.
relax: "20:0:0"
# The ID of the letter to quote while sending this one
quote: 12
# This can be either SMTP or Telegram. If it's SMTP, you have
# to specify the SMTP section in the Lane. If it's Telegram,
# you have to specify telegram chat ID in the Lane.
transport: SMTP
# Maximum amount of emails to be sent per day
speed: 100

Here is how your Liquid template may look like:

{% if first %}
{{first}},
{% else %}
Hi,
{% endif %}

How are you?

—<br/>
Yegor Bugayenko<br/>
To remove your email ({{email}}) from the list, [click here]({{unsubscribe}}).

Recipient

Not implemented yet...

API

You can retrieve the data from the system via the API. First, you have to get the authorization code from the API page. Then, add it to each HTTP request you make, as auth URI parameter. For example, to see the total count of all active subscribers of your list:

/api/lists/123/active_count.json?auth=74fa8672...

All URIs:

  • /api/lists/:id/active_count.json: total active subscibers in the list
  • /api/lists/:id/per_day.json: new subscribers per day (last 10 days stat, change with days)
  • /api/campaigns/:id/deliveries_count.json: deliveries per day (last day, change with days)
  • more coming...

How to contribute

Read these guidelines. Make sure you build is green before you contribute your pull request. You will need to have Ruby 2.3+, Java 8+, Maven 3.2+, PostgreSQL 10+, and Bundler installed. Then:

$ bundle update
$ rake

If it's clean and you don't see any error messages, submit your pull request.

License

(The MIT License)

Copyright (c) 2018 Yegor Bugayenko

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.