Download the PHP package finity-labs/fin-mail without Composer

On this page you can find all versions of the php package finity-labs/fin-mail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package fin-mail

FinMail for Filament

finity-labs-fin-mail

FILAMENT 4.x FILAMENT 5.x Latest Version on Packagist Tests Code Style Total Downloads License

A powerful email template manager and composer for Filament. Build, manage, and send emails directly from your admin panel — with dynamic token replacement, multilingual templates, customizable themes, template versioning, email logging with status tracking, auth email overrides, and a reusable Send Email action that drops into any resource.

Features

Requirements

FinMail uses spatie/laravel-settings to store plugin settings. It's pulled in automatically as a Composer dependency — fin-mail:install publishes and runs its migration if you don't already have a settings table.

Installation

Dependency conflict? If you see an error about phpdocumentor/type-resolver, it means your project has phpdocumentor/reflection-docblock 6.x which conflicts with spatie/laravel-settings. Fix it by allowing Composer to resolve all dependencies:

The install command will:

Non-interactive install

Pass --locales to skip the interactive locale prompt (useful for CI or scripted setups):

During interactive install, choose "Other" from the locale list to manually enter any of the 59 supported locale codes.

Custom Filament theme

If you are using a custom Filament theme, add the FinMail view path to your theme CSS so Tailwind can scan the plugin's styles:

The install command will do this automatically if it detects a custom theme CSS file for the selected panel.

Register the plugin

Plugin options

Extending the resources

To adjust one of the built-in resources, extend it and register your class on the plugin — it replaces the built-in one:

Keep the built-in slug (or override getPages() too) so the plugin's internal links keep resolving.

Navigation customization

All navigation group settings accept strings, enums, closures, or null:

Usage

Sending emails programmatically

TemplateMail is automatically queued. Configure the queue connection and name in config/fin-mail.php.

Logging

When logging is enabled in the FinMail settings, every TemplateMail creates a Sent Emails log entry on its own — no extra setup needed. Queued mail is logged at dispatch time with a Queued status and updated to Sent or Failed once the worker processes it. Each entry records who sent the email: the authenticated user at the time the mailable was built, or nobody for system-triggered mail like scheduled jobs.

Passing extra view data

models() is for token replacement ({{ user.name }}). For variables you want available directly in the Blade template — without going through the token system — use with() or its extraData() alias:

After publishing the package views (php artisan vendor:publish --tag=fin-mail-views), the variables are available directly in the Blade template:

The default keys (body, preheader, theme, branding) remain available — extra data is merged on top.

Overriding branding per email

Branding settings (logo, colors, footer) normally apply to every email. For one-off deviations — a partner co-branded email, a plain internal notice — override them per email:

Any key from the branding settings works (logo, logo_width, logo_height, content_width, primary_color, footer_links, customer_service_email, customer_service_phone); keys you don't pass fall through to the saved settings.

Using a custom email view

By default, FinMail renders emails using the built-in fin-mail::email.default view.

You can override the view on a per-email basis:

The custom view receives the same variables as the default view ($body, $preheader, $theme, $branding) as well as any data provided via with() or extraData().

Adding "Send Email" to any resource

A SendEmailAction (page header action) is also available with the same API.

Showing sent emails on any resource

Add the HasEmailTemplates trait to your model:

Then add the relation manager to your resource:

The trait provides helpers on your model:

Token syntax

Syntax Example Description
{{ model.attr }} {{ user.name }} Model attribute
{{ model.rel.attr }} {{ order.customer.name }} Nested relation
{{ config.key }} {{ config.app.name }} Config value
{{ token \| 'fallback' }} {{ user.name \| 'Customer' }} With fallback
{% if token %}...{% endif %} {% if user.is_premium %}...{% endif %} Conditional
{% if token %}...{% else %}...{% endif %} If/else

Merge tags

When editing a template, any tokens defined in the Tokens tab are available as merge tags in the RichEditor toolbar. Click the merge tags button to browse and insert them directly into the email body.

CTA Button block

The editor includes a built-in Button custom block. Click the custom blocks button (squares-plus icon) in the toolbar, select "Button", and configure:

The button automatically uses your theme's button colors (button_bg and button_text) in both preview and sent emails, with full inline styling for email client compatibility.

Custom blocks

You can register your own custom blocks that work in the editor, preview, and sent emails. Each block must extend Filament's RichContentCustomBlock.

Registered blocks automatically appear in the editor's custom blocks toolbar, render in preview mode, and convert to HTML when emails are sent. ButtonBlock is always included by default.

Each custom block needs to implement:

If your block uses theme colors, add a static setPreviewTheme(?array $theme) method and it will receive theme updates automatically when the user changes the template theme.

Events

FinMail dispatches events at key points in the email lifecycle so your application can react — e.g., log analytics, trigger webhooks, or update related models.

Event When Payload
EmailSending Before the email is sent SentEmail $sentEmail, ?EmailTemplate $template
EmailSent After the email was sent successfully SentEmail $sentEmail, ?EmailTemplate $template
EmailFailed When sending fails SentEmail $sentEmail, string $error, ?EmailTemplate $template
TemplateUpdated When a template is saved (new version) EmailTemplate $template, int $newVersion

Listening to events

All event properties are readonly. Events use SerializesModels so they are safe to dispatch from queued jobs.

Authorization

Without Shield

FinMail works with plain Laravel policies — no extra package needed. Create policy classes named EmailTemplatePolicy, EmailThemePolicy, and SentEmailPolicy in App\Policies (or wherever policyNamespace() points) and FinMail registers them automatically; Filament then applies them to the resources. Policies that don't exist are simply skipped, so you can gate only what you need.

The namespace is a per-panel option, registered when that panel boots for a request, so two panels can point at two sets of policies. Outside any panel — console commands, queue workers, routes of your own — the default panel's namespace applies, or App\Policies when the plugin is not on the default panel.

Settings pages are gated through Gate abilities named after the page class:

Pages without a defined ability stay accessible to any authenticated user, so nothing changes until you opt in.

Filament Shield Integration

FinMail ships with built-in support for Filament Shield. Shield is entirely optional — without it, authorization works as described above.

Automatic setup

If Shield is installed, the fin-mail:install command will:

  1. Register FinMail resources in your filament-shield.php config
  2. Generate policies and permission entries via shield:generate

FinMail automatically maps Shield-generated policies (in App\Policies by default) to its models. If your policies live elsewhere, configure the namespace on the plugin:

Manual setup

If you prefer to set up Shield manually, or if the automatic setup didn't complete:

Supported permissions

Resources:

Resource Permissions
Email Templates ViewAny, View, Create, Update, Delete, Preview, SendTest, Compose
Email Themes ViewAny, View, Create, Update, Delete
Sent Emails ViewAny, View, Resend

Settings pages:

Each settings page (General, Branding, Logging, Attachments, Auth Emails) has its own page-level permission managed by Shield.

Cleanup on uninstall

The fin-mail:uninstall command automatically removes Shield config entries and permission records from the database.

Auth Email Overrides

FinMail can replace the application's default authentication emails (verification, password reset) with your custom templates, and optionally send a welcome email on registration.

Enable overrides

Navigate to Settings → Auth Emails in the admin panel and toggle the overrides you want.

Required templates

Create templates with these keys (the seeder includes them by default):

Template Key Purpose Available Tokens
user-verify-email Email verification link {{ user.name }}, {{ user.email }}, {{ url }}
user-password-reset Password reset link {{ user.name }}, {{ user.email }}, {{ url }}
user-welcome Welcome email after registration {{ user.name }}, {{ user.email }}

Locale support

Auth email overrides automatically use the active application locale (app()->getLocale()). If you use a language switcher plugin, the emails will be sent in the user's selected language — provided the template has a translation for that locale.

Logging auth email bodies

Auth emails are logged like any other email, but their rendered body is kept out of the database by default because it contains signed URLs — anyone able to read the log could replay a still-valid reset link. If you need a full audit trail of exactly what was sent, opt in via the config:

Fallback behavior

If a required template is missing or deactivated, the override falls back to Laravel's default notification email instead of failing — password reset and verification keep working no matter what happens to the templates.

Configuration

Publish the config:

Date formatting

By default, dates and datetimes throughout the plugin use Filament's built-in formatting. You can override this globally or per locale in config/fin-mail.php:

When set to null (or when the current locale isn't in the array), Filament's default formatting kicks in. These formats are standard PHP date format characters.

You can also access the resolved format programmatically:

Other publish tags:

Tag Description
fin-mail-config Configuration file
fin-mail-migrations Database migrations
fin-mail-settings-migrations Spatie Settings migrations
fin-mail-views Email template views

Upgrading

When upgrading from a previous version, run the upgrade command to apply any data migrations:

This checks locked templates in the database against the latest seeder definitions and updates any that are outdated. The command is idempotent and safe to run multiple times.

Preview changes without applying them:

UUID or ULID user models

Since 1.14.1 the migrations size the email_template_versions.created_by and sent_emails.sent_by columns from your auth user model, so a fresh install on a HasUuids or HasUlids user works out of the box. An install that ran the earlier migrations on such a model has integer columns that cannot hold the key. Migrate them once:

Installs on the default integer user model need nothing.

Uninstalling

Run the uninstall command before removing the package:

The uninstall command will:

Testing

License

MIT

Screenshots

📝 Template Management
**Template List** Manage, search, and create email templates with multi-language support. ![Email Templates List View](https://github.com/user-attachments/assets/6e0a0b97-0572-4f6f-bdd2-a765ab26d399) **Template Editor** The editor includes a live preview and a dynamic token selector. ![Template Editor](https://github.com/user-attachments/assets/68e42727-ca4b-42dc-9a9a-ed3db36a2f01) ![Editor Tokens View](https://github.com/user-attachments/assets/a9d2360e-8470-49d3-8055-ca4aa6dae79c)
🎨 Theming
**Theme Editor** Create a consistent brand look with the visual theme editor — no CSS knowledge required. ![Theme Editor](https://github.com/user-attachments/assets/b7a5e904-b879-4576-b08e-681d1023f249)
⚙️ Plugin Configuration
**General Settings** Configure senders, localization, and template categories. ![General Settings](https://github.com/user-attachments/assets/3a5362ea-826a-4c1d-8537-e8569d93e3c7) **Branding Settings** Customize logo, colors, and footer links for your email layout. ![Branding Settings](https://github.com/user-attachments/assets/c6fb26fe-b789-42f7-9bf7-7250bc8f7c81) **Logging Settings** Control how sent emails are recorded and cleaned up. ![Logging Settings](https://github.com/user-attachments/assets/402e3704-3bd3-44de-beb1-249a17705913) **Attachment Settings** Set file size limits and allowed extensions. ![Attachment Settings](https://github.com/user-attachments/assets/8408f05b-7545-49df-a26b-52dd6247caee) **Auth Email Overrides** Replace default Laravel auth emails with your custom templates. ![Auth Override Settings](https://github.com/user-attachments/assets/974704f6-e66a-4a59-8f07-a22d4b333924)

All versions of fin-mail with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^4.0|^5.0
filament/spatie-laravel-settings-plugin Version ^3.0|^4.0|^5.0
illuminate/contracts Version ^11.0|^12.0|^13.0
spatie/laravel-package-tools Version ^1.16
spatie/laravel-settings Version ^3.0|^4.0
finity-labs/fin-support Version ^0.1
spatie/laravel-translatable Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package finity-labs/fin-mail contains the following files

Loading the files please wait ...