Appearance
Mail ​
Overview ​
All Mailables live in app/Mail: 10 in the root, 46 in app/Mail/DAM and 2 in app/Mail/BackOffice. Templates are Blade views under resources/views/emails/. Most DAM notification mails have a Frontend variant (portal users) and a Backend variant (admin users), picked by $emailData['is_front_user'].
Mail goes out through Laravel's smtp mailer. When a workspace has white label turned on and its own SMTP settings saved, the mail for that workspace is sent through the workspace's SMTP server with the workspace's From address. That switch is done by WorkspaceMailService, WorkspaceMailContext and the ApplyWorkspaceMailToMessage listener, described in Workspace mail configuration.
Most mails are sent from a queued job, so the request does not wait on SMTP. See Jobs.
Queued Mailables ​
Five Mailables implement ShouldQueue: FeedbackEmail, DAM\SendDealerUserInvitationEmail, DAM\SendFeedBackEmail, DAM\SendStorageAnalyticsEmail and DAM\SendUserInvitationEmail. Every caller sends them with sendNow(), which skips the mail queue and sends in the current process. This matters: a mail pushed onto the queue would be sent later by a worker with no workspace mail context, so it would go out through the default SMTP. The other Mailables are plain and are sent with send(), usually from inside a queued job.
Brand name in mails ​
Mails that greet the user under the platform name compute $brandName from WorkspaceMailContext::currentWorkspace(): the workspace name when white_label_enabled is on, otherwise "Collage" (UserWelcomeEmail falls back to config('constant.APP_NAME')). SendSsoSeatBlockedEmail uses App\Support\WorkspaceBrand::name(), which does the same check and also provides the support address and the verified custom domain URL for links. Many DAM mails also call from() with constant.MAIL_FROM_ADDRESS or constant.MAIL_NOTIFICATION_ADDRESS and a sender name; under white label the listener overrides that From.
Mailable inventory ​
Root (app/Mail) ​
| Class | Subject | View | Data | Sent by |
|---|---|---|---|---|
FeedbackEmail (queued) | {brand} User Feedback | emails.Common.SendFeedback | $data | Api\v1\FeedbackController, sendNow() in workspace scope |
SendAssetReportEmail | Workspace Asset Report - {workspace} | emails.DAM.assetReport | workspace name, asset count, XLSX attached from memory | dam:export-asset-report |
SendExistingUserInvitation | You're added to {workspace} on {brand} as a user | emails.Common.ExistingUserInvitation | $emailData | Api\v1\User\UsersController |
SendGeneralInvitation | You're added on {brand} | emails.Common.GeneralInvitation | $emailData | UsersController, Api\v1\Workspace\WorkspaceController |
SendMailForChangeUserPassword | Your login password is changed for {brand} | emails.Common.MailForChangeUserPassword | $emailData | UsersController |
SendMonthlyWorkspaceReportEmail | Monthly Workspace Activity Report - {workspace} ({period}) | emails.monthly_workspace_report | workspace name, report data, start and end date; attachment | send:monthly-workspace-reports |
SendPasswordVerificationLink | Reset Your Password | emails.Common.SendResetPasswordLink | $data (reset link) | Api\v1\Auth\AuthController, DAM\v1\Auth\AuthController |
SendSsoSeatBlockedEmail | Add seats: {employee} tried to sign in to {workspace} on {brand} | emails.Common.SsoSeatBlocked | $emailData | Services\Sso\SsoLoginService (to the workspace owner) |
SendUserRegistrationEmail | You're successfully registered on {brand} | emails.Common.UserRegistrationEmail | $emailData | Api\v1\Auth\AuthController |
SendWeeklyPlatformReportEmail | Weekly Platform Activity Report - {date range} | emails.weekly_platform_report | two data sets, start and end date; attachment | send:weekly-platform-report |
BackOffice (app/Mail/BackOffice) ​
| Class | Subject | View | Data | Sent by |
|---|---|---|---|---|
SendNewCustomerCreateEmail | You're invited to set the password for DAM access on {APP_NAME} | emails.BackOffice.createNewCustomer | $emailData | Web\Subscription\SubscriptionController |
SendPayLinkShareToEmail | [Action Needed] Complete payment process for DAM subscription | emails.BackOffice.sharePayLinkInEmail | $emailData | Web\Subscription\SubscriptionController (2 places) |
Account, invitation and subscription (app/Mail/DAM) ​
| Class | Subject | View | Data | Sent by |
|---|---|---|---|---|
DamAccountActivationEmail | You're invited to set the password for access on {brand} | emails.DAM.accountActivationLinkEmail | $emailData | AccountActivationLinkJob |
SendUserInvitationEmail (queued) | You're invited for DAM access on {brand} | emails.DAM.Frontend.userInvitation | $emailData | SendUserInvitationEmailJob; WorkspaceController with sendNow() |
SendDealerUserInvitationEmail (queued) | You're invited to set the password for portal access on {brand} | emails.DAM.dealerUserInvitation | $emailData | SendDealerUserInvitationEmailJob; Api\v1\DigitalAssets\DealerController with sendNow() (3 places) |
UserWelcomeEmail | Welcome To {brand} | emails.Common.userWelcomeEmail | $emailData | UserWelcomeEmailJob |
InstanceEmail | Custom Domain Requested by {workspace} | emails.DAM.Backend.instanceEmail | $emailData | Api\v1\DigitalAssets\DamInstanceController (to support) |
subscriptionCancelEmail | {name} subscription was cancelled | emails.DAM.subscriptionCancelEmail | $emailData | SubscriptionCancelEmailJob (to the admin address) |
SendInvoiceToCustomerEmail | Your invoice from {account} #{invoice number} | emails.DAM.sendInvoiceToCustomer | $emailData; invoice attached | Web\Subscription\UserController, in workspace scope |
SendReceiptToCustomerEmail | built in the class ($subject) | emails.DAM.sendReceiptToCustomer | $emailData | Web\Subscription\UserController, in workspace scope |
TrialEnd | Payment reminder after Trial period over | emails.DAM.trialEnd | $emailData | No sender found |
Welcome | Welcome to {brand}, {user}! | emails.welcomeEmail1 | $emailData | No sender found |
Trial onboarding series (app/Mail/DAM) ​
Sent in order by newsLetterEmail, one step per run, keyed on SubscriptionUsers.email_send_number. Each takes the $user model and passes it to the view as data.
| Step | Class | Subject | View |
|---|---|---|---|
| 1 | DigitalAssetDetails | What are Digital Assets? | emails.digitalAssetDetailsEmail2 |
| 2 | DAMFeature | Collage's DAM Highlight: DAM Insights | emails.damFeatureEmail3 |
| 3 | OrganizeDigitalAsset | 7 Reasons to Organize Your Digital Assets | emails.organizeDigitalAssetEmail4 |
| 4 | ProductFeatureEmbedFiles | Collage's DAM Highlight Directly Embed Files | emails.embedFeatureEmail5 |
| 5 | IncreaseBrandvalue | How Does a DAM Increase Your Brand Value? | emails.increaseBrandvalueEmail6 |
| 6 | SendUserGroupMail | Collage's DAM Highlight: Create User Groups | emails.userGroupEmail7 |
| 7 | SendMarketingLifeMail | Making Marketing Life Easier with DAM | emails.marketingLifeEmail8 |
| 8 | SendFolderPermissionMail | Collage's DAM Highlight: Folder Permissions | emails.folderPermissionEmail9 |
| 9 | SendEndFreeTrialMail | We've only just begun! | emails.endFreeTrialEmail10 |
SendEndFreeTrialMail is also sent by the scheduled trial-end-mail command, and DigitalAssetDetails by the unused SendTuesdayThursdayMailJob. These calls use Mail::to() directly, without a workspace scope.
DAM notifications (app/Mail/DAM) ​
These are sent by DamNotification::sendEmailNotification($slug, $emailData), which SendDamEmailSystemNotificationJob calls after it has applied the workspace mail config. The subject is $emailData['notification_data']['subject'], which comes from the workspace's DamNotification setting. The view is picked from is_front_user and, for some, whether the change is one item, several items or a folder.
| Notification slug | Class | Views (emails.DAM.{Frontend,Backend}.Notification.*) |
|---|---|---|
new-user-creation | SendNewUserCreationEmail | Backend newUserCreateNotificationEmail |
add-new-version-of-asset | SendAddNewAssetVersionEmail | newAssetVersionNotificationEmail |
upload-new-asset-folder | SendUploadNewAssetFolderEmail | uploadNewFolderEmail, uploadNewAssetFolderEmail, uploadMultipleNewAssetFolderEmail |
delete-or-archive-asset-folder | SendDeleteOrArchiveAssetFolderEmail | deleteMultiAssetsFolderNotificationEmail, deleteMultiAssetsFromFolderNotificationEmail, deleteMultiFolderNotificationEmail, deleteMultiAssetsNotificationEmail |
generate-shared-url-for-asset-folder | SendGenerateSharedUrlEmail | Backend generateSharedUrlAssetEmail, generateSharedUrlAssetFolderEmail, generateSharedUrlFolderEmail |
new-collection-created | SendNewCollection | createNewCollection |
add-new-asset-in-collection | SendAddNewAssetsEmail | addAssetsInCollection, addMultipleAssetInCollection |
remove-asset-in-collection | SendRemoveAssetEmail | removeAssetsInCollection |
generate-link-for-sharing-collection | SendGenerateLinkForSharingCollection | Backend generateLinkForSharingCollection |
generate-link-for-sharing-asset-collection | SendGenerateLinkForAssetSharingCollection | Backend generateLinkForSharingAssetCollection |
remove-collection | SendRemoveCollectionEmail | removeCollection |
Other DAM mails (app/Mail/DAM) ​
| Class | Subject | View | Data | Sent by |
|---|---|---|---|---|
AnnouncementEmail | New Announcement Received. | emails.DAM.AnnouncementEmail | $emailData | AnnouncementEmailJob |
SendDailyMail | $emailData['subject'] | emails.DAM.{Frontend,Backend}.Notification.SendDailyMail | $emailData | SendDailyMailJob |
SendConvertAssetsEmailJob | Asset conversion from {type} to {type} is successful. | emails.DAM.{Backend,Frontend}.Notification.assetConvertEmail | $data with a 4-day download URL | ConvertAssetsJob |
SendAssetsDownloadEmailJob | Your download request has processed successfully! | emails.DAM.Backend.Notification.assetDownloadEmail | $data with a 4-day zip URL | CreateAssetsZipFile command |
SendFeedBackEmail (queued) | {name} has submitted a feedback. | emails.DAM.feedbackEmail | $emailData | SendFeedBackEmailJob |
SendStorageAnalyticsEmail (queued) | $emailData['subject'] | emails.DAM.storageAnalyticsEmail | $emailData | SendStorageAnalyticsEmailJob |
SendUserOrderEmail | Your Order is In-Progress! | emails.DAM.Frontend.userOrder | $sendMailData | DAM\v1\Digital\AssetProductOrderController |
SendAdminOrderEmail | Received New Order! | emails.DAM.Backend.adminOrder | $sendMailData | AssetProductOrderController |
SendUserOrderCancelledToAdminEmail | $sendMailData['admin_subject'] | emails.DAM.Backend.userCancleOrder | $sendMailData | AssetProductOrderController |
SendUserOrderCancelledToUserEmail | $sendMailData['user_subject'] | emails.DAM.Frontend.userCancleOrder | $sendMailData | AssetProductOrderController |
SendOrderCancelledAdminEmail | $sendMailData['admin_subject'] | emails.DAM.Backend.adminCancleOrder | $sendMailData | No sender found |
SendOrderCancelledUserEmail | $sendMailData['user_subject'] | emails.DAM.Frontend.adminCancleOrder | $sendMailData | No sender found |
SendOrderStatusEmail | $sendMailData['subject'] | emails.DAM.Frontend.orderStatus | $sendMailData | No sender found |
SendOrderDeliveredStatusEmail | Your order is {Delivered}! | emails.DAM.Frontend.orderStatus | $sendMailData | No sender found |
SendUserInvoiceEmail | $sendMailData['invoice_subject'] | emails.DAM.Frontend.invoice | $sendMailData, $attachment | No sender found |
mail:preview instantiates most of the live workspace-scoped Mailables to send them to a test inbox; it is not listed above as a sender.
Outside app/Mail, Api\v1\User\ExternalUserController sends three raw Mail::send() views (emails.external-user-invite-email, emails.external-user-otp-email, emails.external-user-request-submit-email) in a workspace scope, and EmailControl\EmailManageController references lead mail classes (NewLeadEmail and others) from the legacy LM module that have no class file in this repo.
Workspace mail configuration ​
Four pieces work together:
| Piece | File | Role |
|---|---|---|
WorkspaceMailService | app/Services/WorkspaceMailService.php | applyForWorkspace(Workspace) returns false unless white_label_enabled is on and the workspace's mailSetting has mail_host and mail_from_address. Otherwise it snapshots the env SMTP values once per process, sets mail.mailers.smtp.* (host, port, username, password, encryption) and mail.from.* from the workspace, and calls Mail::purge() so the next send builds a new transport. restoreDefaults() puts the snapshot back. scoped(?int $workspaceId, Closure) sets the context, applies the config, runs the closure, and always clears the context and restores defaults in finally. A null ID just runs the closure. |
WorkspaceMailContext | app/Support/WorkspaceMailContext.php | Static holder of the current workspace ID for this process. currentWorkspace() loads the workspace with mailSetting. Mailables read it for the brand name and the listener reads it for the From address. |
ApplyWorkspaceMailToMessage | app/Listeners/ApplyWorkspaceMailToMessage.php | Listens to Illuminate\Mail\Events\MessageSending (registered in EventServiceProvider). Overrides the message From with the workspace address, or cancels the send. |
ApplyWorkspaceMailConfig | app/Http/Middleware/ApplyWorkspaceMailConfig.php | Resolves the workspace from the workspace_id route parameter, the workspace_id input, the X-Workspace-Id header (slug, then numeric ID) or the user's default_workspace, then sets the context and applies the config. It is not registered in app/Http/Kernel.php or on any route, so it does not run today. Code relies on scoped() instead. |
The workspace SMTP settings live in the WorkspaceMailSetting model (Workspace::mailSetting(), a hasOne). mail:test-smtp {workspace} {email} sends one test mail through them and prints the transport error if it fails.
Sending inside a workspace scope ​
Jobs and controllers wrap the send like this (from AccountActivationLinkJob):
php
app(WorkspaceMailService::class)->scoped(
$this->record['workspace_id'] ?? null,
fn () => Mail::to($this->record['email'])->send(new DamAccountActivationEmail($this->record))
);SendDamEmailSystemNotificationJob does the same by hand: it calls WorkspaceMailContext::setForWorkspaceId() and applyForWorkspace() at the start of handle(), and clears and restores in finally.
MessageSending listener ​
A white-label workspace without complete SMTP details therefore sends no mail at all from inside its scope, instead of falling back to the Collage SMTP. Mail sent outside any scope (for example Mail::to() calls in TrialEndMail, CreateAssetsZipFile, AssetProductOrderController and the BackOffice mails in Web\Subscription\SubscriptionController) is not touched by the listener.