Download the PHP package waynebrummer/mail-telemetry without Composer

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

Laravel Mail Telemetry

Mail Telemetry will hook into all outgoing emails (unless otherwise stated) from Laravel and inject a tracking pixel and links into it.

It will also store the rendered email in the database for review and analytics.

Install

Via Composer:

Publish the config file and migration:

Run the migration:

Note: If you would like to use a different connection to store your models, you should update the mail-telemetry.php config entry connection before running the migrations.


Usage

Once installed, all outgoing mail will be logged to the database.

The following config options are available in config/mail-telemetry.php:

If you do not wish to have an email tracked, then you can add the X-No-Track header to your message. Put any random string into this header to prevent the tracking from occurring. The header will be removed from the email prior to being sent.


** Linking to Notifications table.

If you wish to have an email linked to the Notification model, then you can add the X-Email-Notification-ID header to your message. This will contain the Notification ID just used.

or if you love the power of the Notifiable Trait. YOu can change your toMail function to request a Mailable.

Then in the Mailable you can reference MailMessage class.

The build method will then be used to inject the 'X-Email-Notification-ID' into the email


Note on local development testing

Several people have reporting the tracking pixel not working while they were testing. What is happening with the tracking pixel is that the email client is connecting to your website to log the view. In order for this to happen, images have to be visible in the client, and the client has to be able to connect to your server.

When you are in a local dev environment (i.e. using the .test domain with Valet, or another domain known only to your computer) you must have an email client on your computer.

Further complicating this is the fact that Gmail and some other web-based email clients don't connect to the images directly, but instead connect via proxy.

That proxy won't have a connection to your .test domain and therefore will not properly track emails. I always recommend using mailtrap.io for any development environment when you are sending emails. Not only does this solve the issue (mailtrap.io does not use a proxy service to forward images in the emails) but it also protects you from accidentally sending real emails from your test environment.

Events

When an email is sent, viewed, or a link is clicked, its tracking information is counted in the database using the Pace\MailTelemetry\Models\Email model.

You may want to do additional processing on these events, so an event is fired in these cases:

If you are using the Amazon SNS notification system, an event is fired when you receive a permanent bounce. You may want to mark the email as bad or remove it from your database.

To install an event listener, you will want to create a file like the following:

Passing data to the event listeners

Often times you may need to link a sent email to another model. The best way to handle this is to add a header to your outgoing email that you can retrieve in your event listener.

Here is an example:

and then in your event listener:

Note that the headers you are attaching to the email are actually going out with the message, so do not store any data that you wouldn't want to expose to your email recipients.


Exceptions

The following exceptions may be thrown. You may add them to your ignore list in your exception handler, or handle them as you wish.


Amazon SES features Untested

If you use Amazon SES, you can add some additional information to your tracking. To set up the SES callbacks, first set up SES notifications under your domain in the SES control panel.

Then subscribe to the topic by going to the admin panel of the notification topic and creating a subscription for the URL you copied from the admin page. The system should immediately respond to the subscription request.

If you like, you can use multiple subscriptions (i.e. one for delivery, one for bounces).

See above for events that are fired on a failed message.

For added security, it is recommended to set the topic ARN into the mail-telemetry config.


Authorized Controller Action

Use of spatie/laravel-query-builder and spatie/laravel-json-api-paginate are used to build a rudimentary endpoint.

It can be extended or overwritten as pleased using the config:


Contributing WIP

Please see CONDUCT for details.

Security

If you discover any security related issues, please email @wayne.brummer instead of using the issue tracker.

Credits

License

The Apache License (Apache 2.0). Please see License File for more information.


All versions of mail-telemetry with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
guzzlehttp/guzzle Version ^6.3
aws/aws-php-sns-message-validator Version ^1.5
spatie/laravel-query-builder Version ^2.1
spatie/laravel-json-api-paginate Version ^1.6
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 waynebrummer/mail-telemetry contains the following files

Loading the files please wait ....