New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

bpedroza/laravel-mail-assertions

Make assertions on mail in laravel.
4,257 3
Install
composer require bpedroza/laravel-mail-assertions
Latest Version:v0.1.12
PHP:^7.2|^8.0.0
Laravel:5 – 11
License:MIT
Last Updated:Dec 23, 2024
Links: GitHub  ·  Packagist
Maintainer: bpedroza

Build Status

Laravel Mail Assertions

Make assertions on emails in Laravel 6 - 11

This is a simple package to allow you to make assertions on emails sent with laravel.

This package is inspired by tightenco/mailthief which I used pre laravel 6. Now that package is no longer supported, so I made this one to allow me to migrate without too much hassle.

Installation

composer require bpedroza/laravel-mail-assertions --dev

Usage

First you will need to include the Bpedroza\LaravelMailAssertions\MakesMailAssertions trait in your test.

Next you can start making assertions on emails:

Method Description
assertEmailNotSent Assert no emails were sent
assertEmailSent Assert an email was sent
assertEmailSentFrom Assert an email was sent from a given email address
assertEmailSentTo Assert an email was sent to a given address
assertEmailSentWithSubject Assert an email was sent with a given subject
assertLastEmailContains Assert the last email sent contains a given string

Related Packages

redberry/mailbox-for-laravel

Capture outgoing Laravel mail in a local dashboard and assert against the fully...

45,558 126
sendkit/sendkit-laravel

SendKit integration for Laravel

11,997 6
felrov/laravel-mandrill

Laravel Mandrill Mail Transport

5,550 0
harlan-zw/laravel-modern-mail

Extends the Laravel mail experience.

5,363 3
rulr/laravel-mailpot

A local mail inbox for Laravel

3,292 16

Version History

Version Released PHP Laravel License
v0.1.12 ^7.2|^8.0.0 ~5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0 MIT
v0.1.11 ^7.2|^8.0.0 ~5.5|^6.0|^7.0|^8.0|^9.0|^10.0 MIT
v0.1.10 ^7.2|^8.0.0 ~5.5|^6.0|^7.0|^8.0|^9.0 MIT
v0.1.9 ^7.2 ~5.5|^6.0|^7.0|^8.0 MIT
v0.1.8 ^7.2 ~5.5|^6.0|^7.0 MIT