Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jinyoungbang
Copy link
Contributor

@jinyoungbang jinyoungbang commented Oct 16, 2023

What does this PR do?

This PR implements the feature to send mass announcements to PCT members using AWS.

TODOs:

  • Create MongoDB service wrapper to fetch all emails of people within Vault (might need to create new env vars and stuff)
  • Implement HTML rendering for email(?)

Type of change

  • Fix: Bug fix (non-breaking change which fixes an issue)
  • Refactor: Any code refactoring
  • Chore: technical debt, workflow improvements
  • Feature: New feature (non-breaking change which adds functionality)
  • Documentation: This change requires a documentation update

Tests Performed

Screenshots

Additional Comments

@jinyoungbang jinyoungbang mentioned this pull request Oct 16, 2023
4 tasks
@cwgough cwgough force-pushed the feat/ses-announcements branch from e51a3b0 to 1971a82 Compare October 20, 2023 23:16
@cwgough cwgough marked this pull request as ready for review January 6, 2024 22:02
@jinyoungbang jinyoungbang changed the base branch from dev/v0.1 to dev/v0.2 January 6, 2024 23:41
Copy link
Contributor Author

@jinyoungbang jinyoungbang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cwgough I can't seem to request changes but feel free to look over the comments!



# why is GET needed?
@announcements_routes.route("/announcement", methods=["GET", "POST"], cors=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think GET isn't needed in this case – just have POST!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, GET requests are still made.
image
Adding the method works as a temp fix- I will deal with this later as it doesn't seem like a high priority issue.

return f'Sent emails to {len(emails)} people: {emails}'


# @announcements_routes.route("/test-email")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and if the above works, feel free to get rid of this!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just changed it so you can test just the backend (otherwise the request is empty and no data is sent) so I'll leave it

load_dotenv()

mongo_admin_user = os.getenv('MONGO_ADMIN_USER')
mongo_admin_password = os.getenv('MONGO_ADMIN_PASSWORD')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I attempted a test by manually inputting env variables on our chalice lambda application, but whenever it deploys it, it seems to reset and deletes it to the default config.json variables.

There seems to be a AWS service called Systems Manager Parameter Store (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) and I think I can try give this an attempt on this branch so we can directly call the env vars on the cloud instead!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I can't tell if you have to do this, because I can create a parameter; but I'm not sure if I would be able to deploy it on our app. This does look like the expected solution, though: I think we would just replace our .env with the parameter store and be good to go.

@jinyoungbang jinyoungbang merged commit 3313e69 into dev/v0.2 Jan 12, 2024
@jinyoungbang jinyoungbang deleted the feat/ses-announcements branch January 21, 2025 18:50
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.

3 participants