Closed madassdev closed 2 months ago
The changes involve modifications to the getFromEmail
method in two classes: SubmissionConfirmationMail
and FormSubmissionNotification
. Both classes now include a conditional check that returns a configured email address when the application is self-hosted. If not self-hosted, the original behavior of generating a unique email address with a timestamp is retained. This update enhances the flexibility of email address handling based on the application's hosting configuration.
File | Change Summary |
---|---|
api/app/Mail/Forms/SubmissionConfirmationMail.php api/app/Notifications/Forms/FormSubmissionNotification.php |
Introduced conditional logic in getFromEmail method to return a configured email address if the application is self-hosted; otherwise, it generates a unique email address with a timestamp. |
sequenceDiagram
participant User
participant App
participant MailService
User->>App: Submit Form
App->>MailService: Call getFromEmail()
alt Self-hosted
MailService-->>App: Return configured email address
else Not self-hosted
MailService-->>App: Generate unique email address with timestamp
end
App-->>User: Send Confirmation Email
🐰 In the garden where emails bloom,
A change has come to lift the gloom.
If self-hosted, a steady name,
If not, a timestamp adds some fame.
Hooray for flexibility, we cheer,
With every message, joy draws near! 🌼
api/app/Mail/Forms/SubmissionConfirmationMail.php (1)
`57-60`: **LGTM!** The changes to the `getFromEmail` method look good. The conditional check for self-hosted deployments allows the application to use a different email address configured in the application settings. This enhances the flexibility of the method and does not introduce any breaking changes or side effects.api/app/Notifications/Forms/FormSubmissionNotification.php (1)
`66-68`: **LGTM!** The changes align with the PR objective to fix the email from address in self-hosted mode. Using the configured mail from address in self-hosted mode ensures that the emails have a consistent from address, while generating a unique from address in non-self-hosted mode helps with email deliverability and tracking.
Summary by CodeRabbit