Skip to content

Commit

Permalink
i1023 - set up maildev for staging
Browse files Browse the repository at this point in the history
This commit sets up maildev for staging. It also temporarily enables email for notifications, for testing purposes. This change will be removed after confirmation.

Issue:
- scientist-softserv/palni-palci#1023
  • Loading branch information
ShanaLMoore committed May 1, 2024
1 parent 21be5fa commit e09f9ca
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
6 changes: 6 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,10 @@ def add_default_group_membership!

Hyrax::Group.find_or_create_by!(name: Ability.registered_group_name).add_members_by_id(id)
end

# Mailboxer (the notification system) needs the User object to respond to this method
# in order to send emails
def mailboxer_email(_object)
email
end
end
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
address: ENV['SMTP_ADDRESS'],
domain: ENV['SMTP_DOMAIN'],
port: ENV['SMTP_PORT'],
enable_starttls_auto: true,
enable_starttls_auto: ActiveModel::Type::Boolean.new.cast(ENV.fetch('SMTP_STARTTLS', true)),
authentication: ENV['SMTP_TYPE']
}
# ActionMailer Config
Expand Down
20 changes: 11 additions & 9 deletions ops/staging-deploy.tmpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,22 @@ extraEnvVars: &envVars
value: password
- name: NEGATIVE_CAPTCHA_SECRET
value: $NEGATIVE_CAPTCHA_SECRET
- name: SMTP_ADDRESS
value: "maildev-smtp.maildev.svc.cluster.local"
- name: SMTP_DOMAIN
value: "maildev-smtp.maildev.svc.cluster.local"
- name: SMTP_ENABLED
value: "true"
- name: SMTP_PORT
value: "1025"
- name: SMTP_TYPE
value: "plain"
- name: SMTP_USER_NAME
value: $SMTP_USER_NAME
value: "admin"
- name: SMTP_STARTTLS
value: "false"
- name: SMTP_PASSWORD
value: $SMTP_PASSWORD
- name: SMTP_ADDRESS
value: smtp.mailtrap.io
- name: SMTP_DOMAIN
value: smtp.mailtrap.io
- name: SMTP_PORT
value: "2525"
- name: SMTP_TYPE
value: cram_md5
- name: SOLR_ADMIN_USER
value: admin
- name: SOLR_ADMIN_PASSWORD
Expand Down

0 comments on commit e09f9ca

Please sign in to comment.