Download the PHP package bobwez98/mail-log-laravel without Composer

On this page you can find all versions of the php package bobwez98/mail-log-laravel. 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 mail-log-laravel

Laravel Mail Log

GitHub Workflow Status Latest Version on Packagist

Automatically log outgoing Laravel emails and their send status to your application's database.

Requirements

Features

Installation

Install the Composer package:

The service provider is registered through Laravel package discovery. Run the migrations to create the mail_logs table:

Configuration

Publish the configuration file:

The published configuration is available at config/mail-log-laravel.php:

Mail logging is enabled by default. It can be disabled in your .env file:

How It Works

Before Laravel sends an email, the package:

  1. Generates a unique message ID.
  2. Adds the ID to the email as an X-Mail-Log-ID header.
  3. Creates a mail log with the pending status.

After Laravel dispatches the MessageSent event, the package uses the header to find the corresponding record, changes its status to success, and records when it was sent.

[!IMPORTANT] Exceptions raised while creating or updating mail logs are reported through Laravel's exception handler without interrupting mail delivery. Messages without a To recipient or subject are stored with empty values.

Usage

No changes to your mailables are required. Once installed and migrated, outgoing emails are logged automatically.

Using a framework?

Laravel mail log supports multiple frameworks to add a UI. For example:

Query the logs yourself

Mail logs can be queried through the included Eloquent model:

Each mail log contains the following data:

Attribute Description
message_id Unique UUID used to correlate mail events
status Current LogStatus value
from Formatted sender addresses
to Formatted recipient addresses
subject Email subject
body HTML or plain-text email body
data Laravel mail event data
sent_at Date and time Laravel dispatched the sent event

The available statuses are pending and success.

Laravel dispatches MessageSending and MessageSent events, but it does not provide a MessageFailed event. If the mail transport throws an exception, the package cannot observe that through Laravel's mail events and the record remains pending. Applications that need to track these failures must catch exceptions around their mail sends themselves.

Quality

To ensure the quality of this package, run the following command:

This will execute five tasks:

  1. Checks if the code is correctly formatted
  2. Checks for issues using static code analysis
  3. Makes sure all tests pass
  4. Verifies 100% code coverage
  5. Checks for pending Rector changes

Code coverage requires Xdebug with coverage mode enabled.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please report security vulnerabilities privately to [email protected].

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of mail-log-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
laravel/framework Version ^13.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 bobwez98/mail-log-laravel contains the following files

Loading the files please wait ...