Download the PHP package jojostx/laravel-elasticemail without Composer

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

Table of Contents

Overview

Laravel ElasticEmail is a lightweight wrapper Laravel package that can be used for validating email addresses via the ElasticEmail API. The package supports caching so that you can start validating email addresses instantly.

Installation

Requirements

The package has been developed and tested to work with the following minimum requirements:

Install the Package

You can install the package via Composer:

Publish the Config

You can then publish the package's config file (so that you can make changes to them) by using the following command:

Getting Your ElasticEmail API Key

To use this package and interact with the ElasticEmail API, you'll need to register on the ElasticEmail API website and get your API key. Once you have the key, you can set it in your .env file as shown below:

Usage

Methods

Validating One Email Address

To validate a single email address, you can use the check() method that is provided in the package. This method returns a ValidationResult object.

The example below shows how to validate a single email address:

Validating Multiple Email Addresses

To validate multiple email addresses, you can use the checkMany() method that is provided in the package. This method returns a Collection of ValidationResult objects.

The example below shows how to validate multiple email addresses:

Facade

If you prefer to use facades in Laravel, you can choose to use the provided ElasticEmail facade instead of instantiating the

class manually.

The example below shows an example of how you could use the facade to validate an email address:

Available Validation Result Properties

Field Description
email The email address that the validation was carried out on.
suggestedSpelling A suggested email address in case a typo was detected.
account The local part of the email address. Example: 'mail' in '[email protected]'.
domain The domain part of the email address. Example: 'jojostx.co.uk' in '[email protected]'.
role Whether or not the requested email is a role email address. Example: '[email protected]'.
disposable Whether or not the requested email is disposable. Example: '[email protected]'.
reason A short description for the result of the check.
result An enum () representing the value of the check. ['Valid', 'Invalid', 'Risky', 'Unknown', 'None']
addedAt A Carbon object containing the date and time that the original validation API request was made.

Caching

Caching Validation Results

There might be times when you want to cache the validation results for an email. This can have significant performance benefits for if you try to validate the email again, due to the fact that the results will be fetched from the cache rather than from a new API request.

As an example, if you were importing a CSV containing email addresses, you might want to validate each of the addresses. However, if the CSV contains some duplicated email addresses, it could lead to unnecessary API calls being made. So, by using the caching, each unique address would only be fetched once from the API. To do this, you can use the shouldCache() method.

Using caching is recommended as it reduces the chances of you reaching the monthly request limits or rate limits that are used by ElasticEmail. Read more about the API limits here.

The example below shows how to cache the validation results:

Busting the Cached Validation Results

By default, the package will always try to fetch the validation results from the cache before trying to fetch them via the API. As mentioned before, this can lead to multiple performance benefits.

However, there may be times that you want to ignore the cached results and make a new request to the API. As an example, you might have a cached validation result that is over 6 months old and could possibly be outdated or inaccurate, so it's likely that you want to update the validation data and ensure it is correct. To do this, you can use the fresh() method.

The example below shows how to fetch a new validation result:

Testing

Security

If you find any security related issues, please contact me directly at Jojostx to report it.

Contribution

If you wish to make any changes or improvements to the package, feel free to make a pull request.

To contribute to this library, please use the following guidelines before submitting your pull request:

Credits

Changelog

Check the CHANGELOG to get more information about the latest changes.

License

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


All versions of laravel-elasticemail with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1
illuminate/container Version ^8.0|^9.0
guzzlehttp/guzzle Version ^6.3|^7.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 jojostx/laravel-elasticemail contains the following files

Loading the files please wait ...