diff --git a/app/avo/cards/admin_email_setup_instructions_card.rb b/app/avo/cards/admin_email_setup_instructions_card.rb new file mode 100644 index 0000000000000000000000000000000000000000..d71994d6276f2534ba216e291233dbd932049a2a --- /dev/null +++ b/app/avo/cards/admin_email_setup_instructions_card.rb @@ -0,0 +1,7 @@ +class Avo::Cards::AdminEmailSetupInstructionsCard < Avo::Cards::PartialCard + self.id = "admin_email_setup_instructions" + self.label = "Instructions to Receive Admin Emails" + self.cols = 3 + self.rows = 1 + self.partial = "avo/cards/admin_email_setup_instructions_card" +end diff --git a/app/avo/cards/send_test_email_card.rb b/app/avo/cards/send_test_email_card.rb new file mode 100644 index 0000000000000000000000000000000000000000..7fecba51cd5b52a9733dba4e9834aed083c4d1e7 --- /dev/null +++ b/app/avo/cards/send_test_email_card.rb @@ -0,0 +1,7 @@ +class Avo::Cards::SendTestEmailCard < Avo::Cards::PartialCard + self.id = "test_email" + self.label = "Test Email Distribution" + self.cols = 1 + self.rows = 1 + self.partial = "avo/cards/test_email_card" +end diff --git a/app/avo/dashboards/home_dashboard.rb b/app/avo/dashboards/home_dashboard.rb index e94bfa2b4678be8fdb573622b5d650f2f870e102..2b0eb1ffe6605b33a27c75bb09bd2308ad7badd0 100644 --- a/app/avo/dashboards/home_dashboard.rb +++ b/app/avo/dashboards/home_dashboard.rb @@ -15,5 +15,7 @@ class Avo::Dashboards::HomeDashboard < Avo::Dashboards::BaseDashboard def cards card Avo::Cards::UserRoleCard card Avo::Cards::RegistrationPathCard + card Avo::Cards::AdminEmailSetupInstructionsCard if Current.user.admin? + card Avo::Cards::SendTestEmailCard if Current.user.admin? end end diff --git a/app/views/avo/cards/_admin_email_setup_instructions_card.html.erb b/app/views/avo/cards/_admin_email_setup_instructions_card.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..4836650cd3d7c5aa18e37ed5472e07b9f689bad4 --- /dev/null +++ b/app/views/avo/cards/_admin_email_setup_instructions_card.html.erb @@ -0,0 +1,17 @@ +<div class="flex-1 flex p-4"> + <div class="w-full"> + <p class="text-sm mb-4"> + Admin notifications about role changes, new users, etc., <i>are not sent directly</i> to the admin emails seen in <%= link_to "Users Management", avo.resources_users_path, target: "_blank", class: "text-primary-500 underline hover:text-primary-600" %>. + <br/> + Instead, a <%= link_to "Service Email Address from Vienna University", main_app.service_email_url, target: "_blank", class: "text-primary-500 underline hover:text-primary-600" %> is used as a central hub for admin emails. All admin emails are sent to the service email address (facemf54), which redirects all tickets and notifications as defined in that account. + </p> + <p class="text-sm mb-4"> + The reason behind this is that users can also have direct contact with the admins via backoffice@facem.at, which requires a managed email service anyway. So instead of having two places to manage recipients of admin tickets, we unify the configuration in one place. + </p> + <p class="text-sm mb-4"> + In order to also receive admin emails you will need to ask somebody with access to the service email account to add your email address to + <%= link_to "its email forwarding configuration", main_app.email_forwarding_instructions_url, target: "_blank", class: "text-primary-500 underline hover:text-primary-600" %>. + After that is configured you can send test emails via the "Send Test Email" button. + </p> + </div> +</div> \ No newline at end of file diff --git a/app/views/avo/cards/_test_email_card.html.erb b/app/views/avo/cards/_test_email_card.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..980dbd4a5424dc824ca6a88fcdb099f68e765538 --- /dev/null +++ b/app/views/avo/cards/_test_email_card.html.erb @@ -0,0 +1,15 @@ +<div class="flex-1 flex p-4"> + <div class="w-full"> + <p class="text-sm mb-4">Click the button below to send a test email to all administrators.</p> + <p class="text-sm mb-4"> + This is useful when adding a new admin and checking whether the + <%= link_to "email forwarding", main_app.email_forwarding_instructions_url, target: "_blank", class: "text-primary-500 underline hover:text-primary-600" %> + has been set up correctly. + </p> + + <%= link_to "Send Test Email", + avo.test_email_send_path, + class: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-primary-500 hover:bg-primary-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500", + data: { turbo: false } %> + </div> +</div> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 985409e0781e17b9fcd1ec79373280eb727c1bc0..1b202eed30a51427cdb0b00cdec6839fa2500e0f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -14,6 +14,14 @@ Rails.application.routes.draw do direct :facem_home do "https://facem.at" end + + direct :email_forwarding_instructions do + "https://zid.univie.ac.at/en/forwarding/" + end + + direct :service_email do + "https://zid.univie.ac.at/en/e-mail/#c21958" + end end if defined? ::Avo