Little email client/tracking in my app
I would like to add to my app the ability to send emails to the customer and keep track of them in their profile. What approach do you use? Is there something for Filament?
Ideally, from the customer's profile, I would like to click a button, open a modal, and send a message to their email. Or in some case, automatic email (like order creation, order status)
As a bonus, is it possible to manage customer responses? If the customer responds to the email, can I intercept it?
5 Replies
I remember there is a laravel package for it, but I forgot the name.
You can use Filament to retrieve and display data, present forms for submitting data, and add actions to fire various events. But then you need to write your own code for sending emails and retrieving emails and customer responses. Filament can display things for you, and you can tell it to perform various actions, but you have to build the rest of the logic in your Laravel app. You might leverage other packages to handle other logic as well.
I did something similar for my application. It tracks all of the emails that my application sends. I created a Event listener for the built-in Laravel MessageSent event. Here's a gist of the basic idea.
---
https://gist.github.com/ccc-developer/94d2d369b7739dd98dbe2ac799868cf4
---
For reading emails, I use Postmark App to process any inbound emails to my application.
---
https://postmarkapp.com/developer/user-guide/inbound
---
I created an unique email address for each profile to do the matching and processing.
---
You can avoid the outboard tracking if you use Postmark as they keep 45 days of your emails and make them available to your API.
Gist
Example Email Logger in Laravel
Example Email Logger in Laravel. GitHub Gist: instantly share code, notes, and snippets.
What is inbound processing? | Postmark Developer Documentation
Inbound processing allows you to send inbound emails to Postmark, which we then process and deliver to you via a webhook in nicely formatted JSON.
Ooo ... Thanks Donnell, that's insightful.
thanks @Donnell Wyche!