Skip to content

Conversation

@Vanessa-Chung-1372
Copy link

Summary:
This PR introduces the initial implementation of the Email Notification System for Keep.id. It enables automated email alerts for specific user activities using SendGrid.

Key Features:

  1. Email Templates: HTML templates are separated from code for maintainability. Each activity type has a corresponding email layout for consistent branding and messaging.
  2. SendGrid Integration: Implemented via a SendgridService class for sending transactional emails.
  3. Composite Service Workflow:
  • Calls both ActivityService.save() and EmailService.send() when handling activity.
  • Supports future extension (e.g., logging, analytics, or message queueing).
  1. Activity-Driven Notification:
  • The system checks if an activity type is worth notifying before sending.
  • Modular handleCreateClientActivity and similar methods handle specific cases.
  1. Extensibility:
  • Easy to add new templates and activity types.
  • Prepared for future enhancement with message queues if needed.

Testing:

  • Integration test for triggering notification on CreateClientActivity. (EmailIntTest)
  • If this is in the right direction, we could figure out the activities types that worth sending email and decide the email templates.

<img width="894" height="648" alt="截圖 2025-07-14 下午8 09 35" src="https://github.com/user-attachments/assets/a50f3758-ffa6-4a11-ab08-93d4dc1bc844" /
截圖 2025-07-14 下午8 09 35

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.

2 participants