Skip to content

Create Logic to Notify Academic Advisors of Overloads - #670

Open
ACBerea wants to merge 13 commits into
developmentfrom
AC_NotifAcadAdvisOverloads
Open

Create Logic to Notify Academic Advisors of Overloads#670
ACBerea wants to merge 13 commits into
developmentfrom
AC_NotifAcadAdvisOverloads

Conversation

@ACBerea

@ACBerea ACBerea commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

IMPORTANT

The code currently lacks access to academic advisors' emails from the Tracy database and thus cannot be completed until Labor is contacted. The only information currently in Tracy is advisor names.

Issue Description

When an overload form is approved, we should notify academic advisors.

Fixes issue #355

Changes

  • Created a template for "Labor Overload Form Approved For Academic Advisor" in base_data.py
  • Implemented "Labor Overload Form Approved For Academic Advisor" as an email purpose into emailHandler.py.
  • Implemented logic to pull "Labor Overload Form Approved For Academic Advisor" Template into emailHandler.py.
  • Implemented logic for sending an email using the advisorEmailPurpose.

Testing

  • Follow these steps to gain email access in Slack (These are also in the README.md.):

    • There are a couple of options to test email handling. By default, all emails will be logged to the slack channel #labor-emails in the bereacs workspace.

    • If you want to test with actual emails, use an email other than outlook to test email handler. This setup is specific to gmail, but should work with any other email that allows you to make app passwords

    1. Set up two factor authentication on your Gmail (Security Settings)
    2. Create an App Password through your Gmail. This 16 character password can only be viewed once, so make sure to save it. (NOTE: You won't have the option to create an app password unless step one is completed)
    3. Inside of your secret_config.yaml file set the MAIL_USERNAME and MAIL_DEFAULT_SENDER as your Gmail, set the MAIL_PASSWORD as your new app password as, and set ALWAYS_SEND_MAIL as True. If you want emails to go to their real recipients, remove MAIL_OVERRIDE_ALL from your config or set it to "".
    4. For testing purposes, change the email of the student and supervisor to match another email that can receive your test emails (or you can use MAIL_OVERRIDE_ALL to send everything to the address specified.
  • Ensure you are on the development APP_ENV.

  • Reset the database using the production backup information.

  • Follow these steps in MySQL to add a fake overload form:

    • MySQL access: mysql -u root -proot lsf
    • Insert Overload Form into Database: INSERT INTO emailtemplate (purpose, formType, action, subject, body, audience) VALUES ('Labor Overload Form Approved For Academic Advisor', 'Labor Overload Form', 'Approved', 'Labor Overload Form Approved', '', 'Academic Advisor');
    • Type exit into the terminal.
  • Flask run the program.

  • On the sidebar, open the Administration accordion and click Pending Forms

  • On the Pending Forms page:

    • Select the Pending Overload Forms tab.
    • Click on the action button of any form.
    • Select the manage button on the Actions dropdown.
    • Click the approve toggle, write a description, and click submit.
    • Wait and make sure the Labor Overload form closes. If it does not check the terminal for errors and return to the MySQL or setup steps for email access.
  • Check Slack to see if you have received the email. (It will come with two other emails).

Issues with Current Code

  • When the email is sent, nothing appears in the body.
  • The previously noted academic advisor email issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant