Download the PHP package buildcode/laravel-database-emails without Composer

On this page you can find all versions of the php package buildcode/laravel-database-emails. 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 laravel-database-emails

Run tests Latest Version on Packagist Total Downloads

Introduction

This package allows you to store and send e-mails using the database.

Requirements

This package requires Laravel 10 or 11.

Installation

Require the package using composer.

Publish the configuration files.

Create the database table required for this package.

Add the e-mail cronjob to your scheduler

Usage

Send an email

E-mails are composed the same way mailables are created.

Sending emails to users in your application

By default, the name column will be used to set the recipient's name. If you wish to use something different, you should implement the preferredEmailName method in your model.

By default, the email column will be used to set the recipient's e-mail address. If you wish to use something different, you should implement the preferredEmailAddress method in your model.

By default, the app locale will be used. If you wish to use something different, you should implement the preferredEmailLocale method in your model.

Using mailables

You may also pass a mailable to the e-mail composer.

Attachments

To start attaching files to your e-mails, you may use the attachments method like you normally would in Laravel. However, you will have to use this package's Attachment class.

[!NOTE] Attachment::fromData() and Attachment::fromStorage() are not supported as they work with raw data.

Attaching models to e-mails

You may attach a model to an e-mail. This can be useful to attach a user or another model that belongs to the e-mail.

Scheduling

You may schedule an e-mail by calling later instead of send. You must provide a Carbon instance or a strtotime valid date.

Queueing e-mails

[!IMPORTANT] When queueing mail using the queue function, it is no longer necessary to schedule the email:send command.

If you need more flexibility, you may also pass your own job class:

It could look like this:

Test mode

When enabled, all newly created e-mails will be sent to the specified test e-mail address. This is turned off by default.

E-mails to send per minute

To configure how many e-mails should be sent each command.

Send e-mails immediately

Useful during development when Laravel Scheduler is not running

To enable, set the following environment variable:

Pruning models

By default, e-mails are pruned when they are older than 6 months.

You may change that by adding the following to the AppServiceProvider.php:


All versions of laravel-database-emails with dependencies

PHP Build Version
Package Version
Requires ext-json Version *
laravel/framework Version ^10.0|^11.0
doctrine/dbal Version ^3.8
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 buildcode/laravel-database-emails contains the following files

Loading the files please wait ....