Closed GMayank0310 closed 3 weeks ago
The changes introduce an enhanced email notification system for users leaving a bot, along with API functionality to manage bot membership. New email templates and a DELETE endpoint for users to leave a bot are created, notifying owners when a member departs. Additionally, tests are included to verify the new features and ensure proper handling of various scenarios.
Files | Change Summary |
---|---|
email.yaml | Added entries for email notifications: member_left_bot_subject and member_left_bot_mail_body . |
kairon/api/app/routers/user.py | Introduced a new DELETE endpoint leave_bot for users to leave a bot, notifying owners via email if enabled. |
kairon/shared/account/data_objects.py | Added new field leave_bot_owner_notification to the MailTemplates class. |
kairon/shared/account/processor.py | Added static method process_leave_bot to handle user leave requests and manage bot access and integration tokens. |
kairon/shared/utils.py | Introduced static method __handle_member_left_bot for email notification handling when a member leaves a bot. |
template/emails/leaveBotOwnerNotification.html | Created a new HTML email template for notifying bot owners when a member leaves. |
tests/integration_test/services_test.py | Added multiple tests covering scenarios for leaving a bot, including successful leaves, owner restrictions, and handling of integration tokens. |
sequenceDiagram
participant User
participant API
participant EmailService
participant BotOwner
User->>API: DELETE /leave_bot
API-->>User: Confirm leave
API->>EmailService: Notify Bot Owner
EmailService->>BotOwner: Send email about member leaving
🐇 "In the meadow where bunnies roam,
Bots and emails make us feel at home.
A member hops away, with a joyful leap,
Owners are notified, no need to weep.
Changes abound, like flowers in bloom,
Together we thrive, dispelling the gloom!"
🌼✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Bug Fixes
Tests