forked from usdot-jpo-ode/jpo-cvmanager
-
Notifications
You must be signed in to change notification settings - Fork 2
Intersection API Email Generation and Templating #258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
45f35f8
Adding notif email generation and sending to the iapi
jacob6838 c8cbeeb
Adding notification email examples
jacob6838 3d068d4
Adding iapi email controller
jacob6838 169105e
Fixing EmailServiceTest
jacob6838 6987b60
Update EmailController.java
jacob6838 4d4fce5
Update EmailServiceTest.java
jacob6838 1cb6ae9
Fixing broken config property refs
jacob6838 8361e8e
Updating email generator comments, colors, and content
jacob6838 d4deef4
Updating default iapi env vars to avoid localhost
jacob6838 b5411d8
Update EmailRecipient.java
jacob6838 9eebbe7
Adding email frequency to tables and queries
jacob6838 4b79219
Update launch.json
jacob6838 648b367
Improving getCombinedResponseEntity to handle partial failures
jacob6838 f748fb6
Removing secure env vars from application.yaml
jacob6838 06338b1
Renaming email template to email_template.html
jacob6838 9c89f37
Removing duplicate dependency
jacob6838 c7676b9
Update services/intersection-api/api/src/main/java/us/dot/its/jpo/ode…
jacob6838 0a3330b
Handling unsubscribe URL generation errors
jacob6838 84c8cbe
Merge branch 'intersection-api-email-generation-1' of https://github.…
jacob6838 f1e79bc
Removing unused methods
jacob6838 f00d7f2
Cleaning up email generation code
jacob6838 6825d8d
Writing email provider tests
jacob6838 791aa48
Merge branch 'develop' into intersection-api-email-generation-1
jacob6838 6462be9
Adding sql update script
jacob6838 4c75d2a
Update email_subscription_type_update.sql
jacob6838 249252e
Merge branch 'develop' into intersection-api-email-generation-1
jacob6838 7f116b1
SUpporting authenticated SMTP server
jacob6838 46f3a6d
Merge remote-tracking branch 'origin/develop' into intersection-api-e…
jacob6838 0ec11f6
Regenerating email postgres JPA objects
jacob6838 464672c
Working email sending with JPA repositories
jacob6838 ee3416a
Merge remote-tracking branch 'origin/develop' into intersection-api-e…
jacob6838 17151f1
Temporarily force enabling emailer
jacob6838 8c256e5
Renaming INTERSECTION_SMTP_SERVER_HOST
jacob6838 a3123dd
Merge remote-tracking branch 'origin/develop' into intersection-api-e…
jacob6838 1ee79f1
Adding spring mail ssl trust policy
jacob6838 22fc718
Hardcoding gmail for testing
jacob6838 7a42278
Adding logging for email recipients
jacob6838 0c6f314
Adding additional iapi email logging
jacob6838 963b20e
Adding transport listener for email send debugging
jacob6838 7e19d46
Merge branch 'develop' into intersection-api-email-generation-1
jacob6838 da2e4bb
Merge branch 'develop' into intersection-api-email-generation-1
jacob6838 cb54e2c
Adding sentDate header
jacob6838 c807fae
Reverting add transport listener
jacob6838 8073ea1
Reverting email logging changes
jacob6838 b2ee5c5
Combining GlobalExceptionHandlers
jacob6838 037c27c
Update EmailService.java
jacob6838 0cb6d11
Merge branch 'develop' into intersection-api-email-generation-1
jacob6838 71d735b
Merge branch 'develop' into intersection-api-email-generation-1
jacob6838 d50e16d
Update launch.json
jacob6838 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
resources/sql_scripts/update_scripts/email_subscription_type_update.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| -- user_email_notification table changes | ||
| -- Add new columns to email_type table | ||
| ALTER TABLE public.email_type | ||
| ADD COLUMN IF NOT EXISTS description character varying(256), | ||
| ADD COLUMN IF NOT EXISTS supports_immediate boolean DEFAULT true NOT NULL, | ||
| ADD COLUMN IF NOT EXISTS supports_hourly boolean DEFAULT false NOT NULL, | ||
| ADD COLUMN IF NOT EXISTS supports_daily boolean DEFAULT false NOT NULL, | ||
| ADD COLUMN IF NOT EXISTS supports_weekly boolean DEFAULT false NOT NULL, | ||
| ADD COLUMN IF NOT EXISTS supports_monthly boolean DEFAULT false NOT NULL; | ||
|
|
||
| -- Add constraints to email_type (skip if already exists) | ||
| DO $$ | ||
| BEGIN | ||
| IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'email_type_unique') THEN | ||
| ALTER TABLE public.email_type ADD CONSTRAINT email_type_unique UNIQUE (email_type); | ||
| END IF; | ||
|
|
||
| IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'at_least_one_frequency') THEN | ||
| ALTER TABLE public.email_type ADD CONSTRAINT at_least_one_frequency | ||
| CHECK (supports_immediate OR supports_hourly OR supports_daily OR supports_weekly OR supports_monthly); | ||
| END IF; | ||
| END $$; | ||
|
|
||
|
|
||
| -- Insert or update email types with specific frequency settings | ||
| INSERT INTO public.email_type(email_type, supports_immediate, supports_hourly, supports_daily, supports_weekly, supports_monthly) | ||
| VALUES | ||
| ('Support Requests', true, false, false, false, false), | ||
| ('Firmware Upgrade Failures', true, false, false, false, false), | ||
| ('Daily Message Counts', true, false, false, false, false), | ||
| ('Access Requests', true, false, false, false, false), | ||
| ('Intersection Notification Summary', true, true, true, true, true), | ||
| ('Critical Error Messages', true, false, false, false, false) | ||
| ON CONFLICT (email_type) | ||
| DO UPDATE SET | ||
| supports_immediate = EXCLUDED.supports_immediate, | ||
| supports_hourly = EXCLUDED.supports_hourly, | ||
| supports_daily = EXCLUDED.supports_daily, | ||
| supports_weekly = EXCLUDED.supports_weekly, | ||
| supports_monthly = EXCLUDED.supports_monthly; | ||
|
|
||
|
|
||
|
|
||
| -- Add new columns to user_email_notification table | ||
| ALTER TABLE public.user_email_notification | ||
| ADD COLUMN IF NOT EXISTS immediate boolean DEFAULT true NOT NULL, | ||
| ADD COLUMN IF NOT EXISTS hourly boolean DEFAULT false NOT NULL, | ||
| ADD COLUMN IF NOT EXISTS daily boolean DEFAULT false NOT NULL, | ||
| ADD COLUMN IF NOT EXISTS weekly boolean DEFAULT false NOT NULL, | ||
| ADD COLUMN IF NOT EXISTS monthly boolean DEFAULT false NOT NULL; | ||
|
|
||
| -- Add constraints to user_email_notification (skip if already exists) | ||
| DO $$ | ||
| BEGIN | ||
| IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'user_email_notification_unique') THEN | ||
| ALTER TABLE public.user_email_notification ADD CONSTRAINT user_email_notification_unique UNIQUE (user_id, email_type_id); | ||
| END IF; | ||
|
|
||
| IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'at_least_one_subscription') THEN | ||
| ALTER TABLE public.user_email_notification ADD CONSTRAINT at_least_one_subscription | ||
| CHECK (immediate OR hourly OR daily OR weekly OR monthly); | ||
| END IF; | ||
| END $$; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/PostmarkConfig.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.