Skip to content

Commit

Permalink
configure SMTP settings through ENV vars
Browse files Browse the repository at this point in the history
fixes #1231
  • Loading branch information
drewda committed May 16, 2018
1 parent 8b58daa commit 77c369e
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 23 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

Hello! Please read more about [participating in the Transitland project](https://transit.land/participate/). We welcome comments, questions, and contributions by GitHub issues or [e-mail](mailto:transitland@mapzen.com).
Hello! Please read more about [participating in the Transitland project](https://transit.land/participate/). We welcome comments, questions, and contributions by GitHub issues or [e-mail](mailto:hello@transitland.org).

## Data import issues

Expand Down
2 changes: 1 addition & 1 deletion app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApplicationMailer < ActionMailer::Base
default from: "transitland@mapzen.com" # TODO: change to a transit.land address
default from: 'hello@transitland.org'
layout 'mailer'
end
2 changes: 1 addition & 1 deletion app/views/changeset_mailer/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

<p>Contributions from community members like you help us build Transitland. If you know of other feeds, please submit them, too!</p>

<p>If you have any questions, you can contact the Transitland team at <a href="mailto:transitland@mapzen.com">transitland@mapzen.com</a>.</p>
<p>If you have any questions, you can contact the Transitland team at <a href="mailto:hello@transitland.org">hello@transitland.org</a>.</p>
2 changes: 1 addition & 1 deletion app/views/changeset_mailer/application.txt.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ We're starting to import the feed into the Transitland Datastore. This will make

Contributions from community members like you help us build Transitland. If you know of other feeds, please submit them, too!

If you have any questions, you can contact the Transitland team at transitland@mapzen.com
If you have any questions, you can contact the Transitland team at hello@transitland.org
2 changes: 1 addition & 1 deletion app/views/changeset_mailer/creation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

<p>You will be notified again when your feed has been added to the Feed Registry and the Datastore, or if we encounter any problems along the way.</p>

<p>If you have any questions, you can contact the Transitland team at <a href="mailto:transitland@mapzen.com">transitland@mapzen.com</a>.</p>
<p>If you have any questions, you can contact the Transitland team at <a href="mailto:hello@transitland.org">hello@transitland.org</a>.</p>
2 changes: 1 addition & 1 deletion app/views/changeset_mailer/creation.txt.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ After that, we will start importing the contents of the feed, which adds the sto

You will be notified again when your feed has been added to the Feed Registry and the Datastore, or if we encounter any problems along the way.

If you have any questions, you can contact the Transitland team at transitland@mapzen.com
If you have any questions, you can contact the Transitland team at hello@transitland.org
13 changes: 6 additions & 7 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,16 @@ def self.base_url_options
elsif Rails.env.staging? || Rails.env.production?
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
config.action_mailer.raise_delivery_errors = false

# use Mandrill to send e-mail
config.action_mailer.smtp_settings = {
address: "smtp.sparkpostmail.com",
port: 587,
address: Figaro.env.smtp_address,
port: Figaro.env.smtp_port.presence.to_i || 587,
enable_starttls_auto: true,
user_name: Figaro.env.mandrill_user_name,
password: Figaro.env.mandrill_password,
user_name: Figaro.env.smtp_user_name,
password: Figaro.env.smtp_password,
authentication: :plain,
domain: 'mapzen.com' # TODO: change to transit.land
domain: 'transitland.org'
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class
# with default "from" parameter.
config.mailer_sender = 'transitland@mapzen.com'
config.mailer_sender = 'hello@transitland.org'

# Configure the class responsible to send e-mails.
# config.mailer = 'Devise::Mailer'
Expand Down
4 changes: 4 additions & 0 deletions config/sample.application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ FEED_INFO_CACHE_EXPIRATION: '14400'
AUTO_FETCH_FEED_VERSION: 'true'
GTFS_TMPDIR_BASEPATH: null
ENQUEUE_NEXT_FEED_VERSIONS_MAX: 0
SMTP_ADDRESS: smtp.sparkpostmail.com
SMTP_PORT: '587'
SMTP_USER_NAME: SMTP_Injection
SMTP_PASSWORD: XXX
2 changes: 1 addition & 1 deletion db/sample-changesets/actransit.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"changeset": {
"user": {
"email": "transitland@mapzen.com",
"email": "hello@transitland.org",
"name": "Transitland staff",
"user_type": "data_enthusists"
},
Expand Down
2 changes: 1 addition & 1 deletion db/sample-changesets/bart.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"changeset": {
"user": {
"email": "transitland@mapzen.com",
"email": "hello@transitland.org",
"name": "Transitland staff",
"user_type": "data_enthusists"
},
Expand Down
2 changes: 1 addition & 1 deletion db/sample-changesets/caltrain.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"changeset": {
"user": {
"email": "transitland@mapzen.com",
"email": "hello@transitland.org",
"name": "Transitland staff",
"user_type": "data_enthusists"
},
Expand Down
2 changes: 1 addition & 1 deletion db/sample-changesets/nycdotsiferry.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"changeset": {
"user": {
"email": "transitland@mapzen.com",
"email": "hello@transitland.org",
"name": "Transitland staff",
"user_type": "data_enthusists"
},
Expand Down
2 changes: 1 addition & 1 deletion db/sample-changesets/nyct.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"changeset": {
"user": {
"email": "transitland@mapzen.com",
"email": "hello@transitland.org",
"name": "Transitland staff",
"user_type": "data_enthusists"
},
Expand Down
2 changes: 1 addition & 1 deletion db/sample-changesets/path.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"changeset": {
"user": {
"email": "transitland@mapzen.com",
"email": "hello@transitland.org",
"name": "Transitland staff",
"user_type": "data_enthusists"
},
Expand Down
2 changes: 1 addition & 1 deletion db/sample-changesets/samtrans.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"changeset": {
"user": {
"email": "transitland@mapzen.com",
"email": "hello@transitland.org",
"name": "Transitland staff",
"user_type": "data_enthusists"
},
Expand Down
2 changes: 1 addition & 1 deletion db/sample-changesets/sfmta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"changeset": {
"user": {
"email": "transitland@mapzen.com",
"email": "hello@transitland.org",
"name": "Transitland staff",
"user_type": "data_enthusists"
},
Expand Down
2 changes: 1 addition & 1 deletion db/sample-changesets/vta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"changeset": {
"user": {
"email": "transitland@mapzen.com",
"email": "hello@transitland.org",
"name": "Transitland staff",
"user_type": "data_enthusists"
},
Expand Down
4 changes: 4 additions & 0 deletions doc/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ key | possible values | default | description
`FEED_INFO_CACHE_EXPIRATION` | Any integer > 0 | 14400 seconds | Cache expiration time, in seconds, for FeedInfo results
`AUTO_FETCH_FEED_VERSION` | `true`, `false` | `false` | Automatically run FeedFetch to create FeedVersion when a Feed is created
`GTFS_GRAPH_VERSION` | `1`, `2` | `2` | Use legacy GTFSGraph by setting to 1. This option may be removed in the future.
`SMTP_ADDRESS` | `smtp.sparkpostmail.com` | none | send email notifications using this SMTP service
`SMTP_PORT` | 587 | none | port for SMTP service
`SMTP_USER_NAME` | `SMTP_Injection` | none | user name for SMTP service
`SMTP_PASSWORD` | your password | none | password for SMTP service

0 comments on commit 77c369e

Please sign in to comment.