Download the PHP package eduardokum/laravel-mail-auto-embed without Composer

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

Packagist Packagist Packagist GitHub Actions GitHub forks

Laravel Mail Auto Embed

Automatically parses your messages and embeds the images found into your mail, replacing the original online-version of the image.

Should work on Laravel 5.3+. Automatically tested for Laravel 5.4+ on PHP 7.0+.

Version Compatibility

Laravel Package
\< 8.x 1.x
> 9.x 2.x

Install

You can install the package via composer:

This package uses Laravel 5.5 Package Auto-Discovery. For previous versions of Laravel, you need to add the following Service Provider:

Usage

Its use is very simple, you write your markdown normally:

When sending, it will replace the link that would normally be generated:

<img src="https://domain.com/products/product-1.png">

by an embedded inline attachment of the image:

<img src="cid:[email protected]">.

It works for raw html too:

If you do not want to use automatic embedding for specific images (because they are hosted elsewhere, if you want to use some kind of image tracker, etc.), simply add the attribute data-skip-embed in the image tag:

Local resources

For local resources that are not available publicly, use file:// urls:

Configuration

The defaults are set in config/mail-auto-embed.php. You can copy this file to your own config directory to modify the values using this command:

Explicit embedding configuration

By default, images are embedded automatically, unless you add the data-skip-embed attribute.

You can also disable auto-embedding globally by setting the MAIL_AUTO_EMBED environment variable to false, or by modifying the enabled property in the published config. You can then enable embedding for individual images with the data-auto-embed attribute.

Base64 embedding

If you prefer to use Base64 instead of inline attachments, you can do so by setting the MAIL_AUTO_EMBED_METHOD environment variable or the method config property to base64.

Note that it will increase the e-mail size, and that it won't be decoded by some e-mail clients such as Gmail.

Mixed embedding methods

If you want to use both inline attachment and Base64 depending on the image, you can specify the embedding method as the data-auto-embed attribute value:

Embedding entities

You might want to embed images that don't actually exist in your filesystem (stored in the database).

In that case, make the entities you want to embed implement the EmbeddableEntity interface:

Then, you can use the embed:ClassName:id syntax in your e-mail template:

Contributing

Please feel free to submit pull requests if you can improve or add any features.

We are currently using PSR-2. This is easy to implement and check with the PHP Coding Standards Fixer.

Donate with Paypal


All versions of laravel-mail-auto-embed with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0
ext-dom Version *
illuminate/contracts Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/mail Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
masterminds/html5 Version ^2.7
ext-curl Version *
ext-fileinfo Version *
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 eduardokum/laravel-mail-auto-embed contains the following files

Loading the files please wait ....