Skip to content

Commit

Permalink
Merge branch 'staging' into feature/agenda-clean
Browse files Browse the repository at this point in the history
  • Loading branch information
lodewiges authored Nov 21, 2024
2 parents d9a6ea5 + 4003999 commit 2211f20
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app/jobs/user_archive_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def create_global_archive_user

User.create!(id: ARCHIVE_USER_ID,
username: 'archived.user',
email: '[email protected]',
email: Rails.application.config.x.ict_email,
first_name: 'Gearchiveerde',
last_name: 'Gebruiker',
address: 'Onbekend',
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: '[email protected]'
default from: Rails.application.config.x.noreply_email
layout 'mailer'
end
4 changes: 2 additions & 2 deletions app/mailers/mail_smtp_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ def enabled_email(mail_alias, password)
# since we do not want to send the password to mail management
def notify_management_enable_email(mail_alias)
@mail_alias = mail_alias
mail to: '[email protected]',
mail to: Rails.application.config.x.mailbeheer_email,
subject: "SMTP account voor #{mail_alias.email} aangemaakt"
end

# Mail to notify the user and mail management that their SMTP is removed
def disabled_email(mail_alias)
@mail_alias = mail_alias
mail to: '[email protected]', bcc: mail_alias.mail_addresses,
mail to: Rails.application.config.x.mailbeheer_email, bcc: mail_alias.mail_addresses,
subject: "SMTP account voor #{mail_alias.email} opgeheven"
end
end
2 changes: 1 addition & 1 deletion app/mailers/user_cleanup_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ def cleanup_email(will_archive_users, archived_users)
' staan op het punt gearchiveerd te worden'
subject = 'Er zijn gebruikers gearchiveerd!' if @will_archive_users.empty?

mail to: '[email protected];[email protected]', subject:
mail to: Rails.application.config.x.privacy_email, subject:
end
end
3 changes: 2 additions & 1 deletion app/mailers/user_export_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ def privacy_notification_email(exporting_user, group, fields, description)
@group = group
@fields = fields
@description = description
mail to: '[email protected]', subject: '[Privacy] Er is een database-export gemaakt' # rubocop:disable Rails/I18nLocaleTexts
mail to: Rails.application.config.x.privacy_email,
subject: '[Privacy] Er is een database-export gemaakt' # rubocop:disable Rails/I18nLocaleTexts
end
end
2 changes: 1 addition & 1 deletion app/views/mail_bounce_mailer/address_unknown.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
U heeft geprobeerd een mail te versturen naar een @csvalpha.nl mailadres. Deze kan helaas niet bezorgd worden. Het gebruikte mailadres <b><%= @to %></b> is namelijk niet in gebruik. Controleer het mailadres nogmaals.
<br/><br/>

Mocht u zeker zijn dat het mailadres klopt of niet weten welk mailadres u moet gebruiken kunt u mailen naar [email protected]
Mocht u zeker zijn dat het mailadres klopt of niet weten welk mailadres u moet gebruiken kunt u mailen naar <a href="mailto:<%= Rails.application.config.x.ict_email %>" style="color: #adb5bd"><%= Rails.application.config.x.ict_email %></a>
3 changes: 2 additions & 1 deletion app/views/mail_bounce_mailer/mail_bounced.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Uw bericht met als onderwerp "<%= @subject %>" aan "<%= @to %>" is helaas niet succesvol afgeleverd.<br/>
De reden hiervoor is: <b><%= @reason %></b>. Mocht dit een bericht aan een mailgroep zijn kan het ook zijn dat het bericht maar bij één ontvanger niet is aangekomen.<br/><br/>

Voor meer vragen kunt u mailen naar [email protected]
Voor meer vragen kunt u mailen naar <a href="mailto:<%= Rails.application.config.x.ict_email %>" style="color: #adb5bd"><%= Rails.application.config.x.ict_email %></a>

2 changes: 1 addition & 1 deletion app/views/user_cleanup_mailer/cleanup_email.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- <%= user.full_name %>
<% end %><br/><br/>

Vergeet niet de lidmaatschapsformulieren van deze leden te vernietigd. Als dit gebeurd is zouden we dan op de hoogte kunnen worden gebracht door middel van een mailtje naar [email protected].
Vergeet niet de lidmaatschapsformulieren van deze leden te vernietigd. Als dit gebeurd is zouden we dan op de hoogte kunnen worden gebracht door middel van een mailtje naar <%= Rails.application.config.x.privacy_email %>.

<% end %>
<br/>
Expand Down
5 changes: 5 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,10 @@ class Application < Rails::Application
config.x.google_api_key = credentials.dig(Rails.env.to_sym, :google_api_key)

config.x.healthcheck_ids = credentials.dig(Rails.env.to_sym, :healthcheck_ids)

config.x.noreply_email = ENV.fetch('NOREPLY_EMAIL', '[email protected]')
config.x.ict_email = ENV.fetch('ICT_EMAIL', '[email protected]')
config.x.privacy_email = ENV.fetch('PRIVACY_EMAIL', '[email protected]')
config.x.mailbeheer_email = ENV.fetch('PRIVACY_EMAIL', '[email protected]')
end
end
10 changes: 5 additions & 5 deletions db/migrate/20241027103012_create_study_room_presence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ def change
t.datetime :deleted_at
t.timestamps
end
end

Permission.create(name: 'study_room_presence.create')
Permission.create(name: 'study_room_presence.read')
Permission.create(name: 'study_room_presence.update')
Permission.create(name: 'study_room_presence.destroy')
Permission.find_or_create_by!(name: 'study_room_presence.create')
Permission.find_or_create_by!(name: 'study_room_presence.read')
Permission.find_or_create_by!(name: 'study_room_presence.update')
Permission.find_or_create_by!(name: 'study_room_presence.destroy')
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2024_11_13_104056) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

Expand Down Expand Up @@ -484,7 +485,7 @@
t.index ["datetime"], name: "index_quickpost_messages_on_datetime"
t.index ["deleted_at"], name: "index_quickpost_messages_on_deleted_at"
end

create_table "room_adverts", force: :cascade do |t|
t.string "house_name", null: false
t.string "contact", null: false
Expand Down
4 changes: 2 additions & 2 deletions spec/jobs/smtp_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
it { expect(mail.bcc).to eq mail_alias.mail_addresses }
it { expect(mail.subject).to eq "Je kunt nu mail versturen vanaf #{mail_alias.email}!" }

it { expect(management_mail.to).to eq ['[email protected]'] }
it { expect(management_mail.to).to eq [Rails.application.config.x.mailbeheer_email] }

it {
expect(management_mail.subject).to eq "SMTP account voor #{mail_alias.email} aangemaakt"
Expand All @@ -47,7 +47,7 @@

it { expect(client).to have_received(:delete_smtp) }
it { expect(mail.bcc).to eq mail_alias.mail_addresses }
it { expect(mail.to).to eq ['[email protected]'] }
it { expect(mail.to).to eq [Rails.application.config.x.mailbeheer_email] }
it { expect(mail.subject).to eq "SMTP account voor #{mail_alias.email} opgeheven" }
end
end
Expand Down
3 changes: 1 addition & 2 deletions spec/jobs/user_cleanup_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@

context 'when with will archive and archived users' do
it { expect(ActionMailer::Base.deliveries.count).to eq 1 }
it { expect(email.to).to include '[email protected]' }
it { expect(email.to).to include '[email protected]' }
it { expect(email.to).to include Rails.application.config.x.privacy_email }
it { expect(email.body.to_s).to include(almost_archive_user.full_name) }
it { expect(email.body.to_s).not_to include(user.full_name) }
it { expect(email.body.to_s).to include('Er is 1 gebruiker gearchiveerd.') }
Expand Down
2 changes: 1 addition & 1 deletion spec/jobs/user_export_mailer_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
end

it { expect(ActionMailer::Base.deliveries.count).to eq 1 }
it { expect(privacy_notification_email.to.first).to eq '[email protected]' }
it { expect(privacy_notification_email.to).to eq [Rails.application.config.x.privacy_email] }
it { expect(privacy_notification_email.body.to_s).to include(exporting_user.full_name) }
it { expect(privacy_notification_email.body.to_s).to include(group.name) }
it { expect(privacy_notification_email.body.to_s).to include(fields.join(', ')) }
Expand Down

0 comments on commit 2211f20

Please sign in to comment.