Skip to content

Commit

Permalink
Merge pull request Katello#1387 from bbuckingham/fork-email_from
Browse files Browse the repository at this point in the history
emails - add default From to login/password emails
  • Loading branch information
xsuchy committed Jan 13, 2013
2 parents af7fa1e + e96a745 commit 42f5a8e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
Expand Up @@ -44,7 +44,12 @@ common:

password_reset_expiration: 120

# Availabe language locale choices. (Note: Syntax for yaml requires a space after each comma ', ')
# email_reply_address is used to specify the "From:" address included
# in emails sent from the Server. If not specified, it will default to
# no-reply@host, where host is the value specified above.
email_reply_address:

# Available language locale choices. (Note: Syntax for yaml requires a space after each comma ', ')
# Default available locales are below
available_locales: ["bn", "de", "en", "es", "fr", "gu", "hi", "it", "ja", "kn", "ko", "mr", "or", "pa", "pt-BR",
"ru", "ta", "te", "zh-CN", "zh-TW"]
Expand Down
2 changes: 2 additions & 0 deletions src/app/mailers/user_mailer.rb
Expand Up @@ -13,6 +13,8 @@
class UserMailer < ActionMailer::Base
include AsyncOrchestration

default :from => Katello.config.email_reply_address

def send_password_reset(user)
# TODO: temporarily hardcoding org to the first org... this will be changed to use the user's default org, once
# that logic is merged in
Expand Down
7 changes: 6 additions & 1 deletion src/config/katello.template.yml
Expand Up @@ -43,7 +43,12 @@ common:

password_reset_expiration: 120

# Availabe language locale choices. (Note: Syntax for yaml requires a space after each comma ', ')
# email_reply_address is used to specify the "From:" address included
# in emails sent from the Server. If not specified, it will default to
# no-reply@host, where host is the value specified above.
email_reply_address:

# Available language locale choices. (Note: Syntax for yaml requires a space after each comma ', ')
# Default available locales are below
available_locales: ["bn", "de", "en", "es", "fr", "gu", "hi", "it", "ja", "kn", "ko", "mr", "or", "pa", "pt-BR",
"ru", "ta", "te", "zh-CN", "zh-TW"]
Expand Down
5 changes: 4 additions & 1 deletion src/lib/katello_config.rb
Expand Up @@ -322,6 +322,9 @@ def post_process config
config[:use_pulp] = config.katello? if config[:use_pulp].nil?
config[:use_foreman] = config.katello? if config[:use_foreman].nil?

config[:email_reply_address] = config[:email_reply_address] ?
config[:email_reply_address] : "no-reply@"+config[:host]

load_version config
end

Expand Down Expand Up @@ -358,7 +361,7 @@ def config_file_path
cloud_forms use_pulp cdn_proxy use_ssl warden katello? url_prefix foreman
search use_foreman password_reset_expiration redhat_repository_url port
elastic_url rest_client_timeout elastic_index allow_roles_logging
katello_version pulp tire_log log_level log_level_sql)
katello_version pulp tire_log log_level log_level_sql email_reply_address)

has_values :app_mode, %w(katello headpin)
has_values :url_prefix, %w(/headpin /sam /cfse /katello)
Expand Down

0 comments on commit 42f5a8e

Please sign in to comment.