-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'joanna-visual-cues-improvements' of github.com:autolab/…
…Autolab into joanna-visual-cues-improvements
- Loading branch information
Showing
4 changed files
with
24 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,9 +75,6 @@ Autolab3::Application.configure do | |
# with SQLite, MySQL, and PostgreSQL) | ||
# config.active_record.auto_explain_threshold_in_seconds = 0.5 | ||
|
||
# default from | ||
ActionMailer::Base.default :from => ENV.fetch('SMTP_DEFAULT_FROM','[email protected]') | ||
|
||
# option for using sendmail | ||
# config.action_mailer.delivery_method = :sendmail | ||
|
||
|
@@ -112,6 +109,9 @@ Autolab3::Application.configure do | |
if File.size?("#{Rails.configuration.config_location}/smtp_config.yml") | ||
config_hash = YAML.safe_load(File.read("#{Rails.configuration.config_location}/smtp_config.yml")) | ||
|
||
# default from | ||
ActionMailer::Base.default :from => config_hash['from'] | ||
|
||
config.action_mailer.perform_deliveries = true | ||
config.action_mailer.raise_delivery_errors = true | ||
config.action_mailer.delivery_method = :smtp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,19 @@ | |
|
||
Autolab requires mailing to allow users to register accounts and reset passwords. You will also be able to make announcements through Autolab as well. The recommended approach is to setup Autolab to use a SMTP server, such as [mailgun](https://mailgun.com), [SendGrid](https://sendgrid.com), [Amazon SES](https://aws.amazon.com/ses/) or any other valid SMTP mail servers to send out email. | ||
|
||
We intend this instructions mainly for production usage. | ||
We intend these instructions mainly for production usage. | ||
|
||
## Mailing for Autolab Docker Installation | ||
To set Autolab Docker up for a custom SMTP Server, update the following in `.env` that was created for you. | ||
## Mailing for Autolab version >=3.0.0 | ||
To set up Autolab (>=3.0.0) for a custom SMTP Server, configure settings by clicking `Manage Autolab` > `Configure Autolab` > `SMTP Config`. | ||
|
||
## I don't have a domain name, will mailing work? | ||
Mailing has been tested to work with SendGrid without a domain name (using the IP of the server as the domain name for the purposes of the configuration above), although the absence of a domain name will likely result in the email to be flagged as spam. For the purpose of testing, a testing mailbox service like [MailTrap](https://mailtrap.io/) is recommended. | ||
|
||
## What if I'm running an outdated version of Autolab? | ||
If you are running an Autolab version less than v3.0.0, refer to the documentation down below to configure SMTP. | ||
|
||
### Mailing for Autolab Docker Installation | ||
To set Autolab Docker up for a custom SMTP Server, update the following in `.env` that was created for you. | ||
|
||
1. Update the host domain | ||
|
||
|
@@ -31,11 +40,11 @@ To set Autolab Docker up for a custom SMTP Server, update the following in `.env | |
::: | ||
[email protected] | ||
|
||
Here the from address **must** be a address that your SMTP service permits you to send from. Oftentimes it is the same as your user_name in the smtp settings. | ||
Here the from address **must** be an address that your SMTP service permits you to send from. Oftentimes it is the same as your user_name in the smtp settings. | ||
|
||
After which, doing a `docker-compose down` followed by `docker-compose up -d` will allow you to see the changes. | ||
|
||
## Mailing for Autolab Manual Installation | ||
### Mailing for Autolab Manual Installation | ||
To set Autolab up to use a custom SMTP Server, you will need to make edits to the `.env` and `production.rb` files that you have created. (If you would like to test it in development, add the following settings into `development.rb`). Both `production.rb` and `development.rb` are located under `config/environments` | ||
|
||
1. Update the host domain of your Autolab instance in `.env` | ||
|
@@ -46,7 +55,7 @@ To set Autolab up to use a custom SMTP Server, you will need to make edits to th | |
The value should be the domain in which Autolab is hosted on. (e.g. `autolab.andrew.cmu.edu`) | ||
|
||
2. Update the custom smtp server settings in `production.rb` | ||
|
||
:::ruby | ||
config.action_mailer.smtp_settings = { | ||
address: 'smtp.example.com', | ||
|
@@ -57,17 +66,14 @@ To set Autolab up to use a custom SMTP Server, you will need to make edits to th | |
password: 'example', | ||
domain: 'example.com', | ||
} | ||
Refer to the SMTP settings instructions that your selected service provides you such as [SendGrid SMTP for Ruby on Rails](https://sendgrid.com/docs/for-developers/sending-email/rubyonrails/), [Amazon SES](https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-smtp.html). | ||
|
||
Refer to the SMTP settings instructions that your selected service provides you such as [SendGrid SMTP for Ruby on Rails](https://sendgrid.com/docs/for-developers/sending-email/rubyonrails/), [Amazon SES](https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-smtp.html). | ||
|
||
3. Update the "from" setting in `production.rb` | ||
|
||
:::ruby | ||
ActionMailer::Base.default :from => '[email protected]' | ||
|
||
Here the from address **must** be a address that your SMTP service permits you to send from. Oftentimes it is the same as your user_name in the smtp settings. | ||
|
||
Make sure to restart your Autolab client to see the changes. | ||
Here the from address **must** be an address that your SMTP service permits you to send from. Oftentimes it is the same as your user_name in the smtp settings. | ||
|
||
# I don't have a domain name, will mailing work? | ||
Mailing has been tested to work with SendGrid without a domain name (using the IP of the server as the domain name for the purposes of the configuration above), although the absence of a domain name will likely result in the email to be flagged as spam. For the purpose of testing, a testing mailbox service like [MailTrap](https://mailtrap.io/) is recommended. | ||
Make sure to restart your Autolab client to see the changes. |