Implement email tracking and reply functionality #142
Merged
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.
This pull request was created by Sweep to resolve the following request by @curtisdelicata:
Continue chatting at https://sweep-chat-demo.vercel.app/c/a6a73ae7-61a2-425e-863c-484a0acf8b5c.
Purpose
This pull request adds the ability to track and manage email messages within the CRM application. It includes the following key features:
Description
Email Tracking: The
GmailService
andMessageService
classes have been updated to track incoming and outgoing email messages. When a message is retrieved or sent, the relevant details (sender, recipient, subject, content, timestamp, and sent/received status) are stored in theemails
database table.Email Reply: The
GmailService
andMessageService
classes now include functionality to create and send email replies. When a user replies to an email, the reply message is constructed and sent using the Gmail API, and the sent message is also tracked in theemails
table.Unified Helpdesk View: The
messages.blade.php
view has been updated to display the tracked email messages alongside the existing WhatsApp and Facebook Messenger messages. This provides a unified view of all incoming and outgoing messages within the CRM application.Email Tracking Integration Test: A new
EmailTrackingIntegrationTest
has been added to ensure the email tracking and reply functionality work as expected.Email Tracking Unit Test: A new
EmailTrackingTest
has been added to test thetrackEmail()
method in theGmailService
class.Summary
The key changes in this pull request include:
app/Filament/App/Resources/ContactResource.php
: AddedEmail
model to the contact resource.app/Models/Email.php
: New model to represent email messages.app/Services/GmailService.php
: Added email tracking and reply functionality.app/Services/MessageService.php
: Added email tracking and reply functionality.database/migrations/YYYY_MM_DD_HHMMSS_create_emails_table.php
: New migration to create theemails
table.resources/views/helpdesk/messages.blade.php
: Updated the helpdesk view to display tracked email messages.tests/Feature/EmailTrackingIntegrationTest.php
: New integration test for email tracking and reply.tests/Unit/EmailTrackingTest.php
: New unit test for thetrackEmail()
method inGmailService
.