https://github.com/settermjd/sendgrid-email-testing
A small project showing how to test emails sent with SendGrid in PHP
https://github.com/settermjd/sendgrid-email-testing
Last synced: 10 months ago
JSON representation
A small project showing how to test emails sent with SendGrid in PHP
- Host: GitHub
- URL: https://github.com/settermjd/sendgrid-email-testing
- Owner: settermjd
- License: gpl-3.0
- Created: 2025-02-21T11:12:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-03T07:08:46.000Z (over 1 year ago)
- Last Synced: 2025-07-24T21:10:51.662Z (11 months ago)
- Language: PHP
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Testing the Sendgrid PHP Helper Library
This is a small project showing how to test emails sent with SendGrid in PHP using SendGrid's PHP Helper Library.
## Prerequisites
To use the project, you'll need the following:
- [Composer][composer] installed globally
- [PHP][php] 8.3
- Some command-line/terminal experience
## What is the project about?
The project isn't designed to be used, rather as an examination of how you could add tests to your PHP applications when you integrate against SendGrid (specifically, sending emails) using [SendGrid's PHP Helper Library][sendgrid-php-helper-library].
Tag 1.0.0 of the application is a small web-based API using [Mini Mezzio][mini-mezzio] to simplify its creation.
It uses a slightly refactored version of [the PHP sample code from the SendGrid docs][send-email-sendgrid-docs] that shows how to send an email.
## Getting Started
If you do want to use the project, clone the project to your development machine (wherever you store PHP projects), change into the new project directory, and install the PHP dependencies, by running the commands below:
```bash
git clone git@github.com:settermjd/sendgrid-email-testing.git
cd sendgrid-email-testing
composer install
```
Then, copy _.env.example_ as _.env_, [create a SendGrid API key][sendgrid-create-api-key], and replace `` with the key.
[composer]: https://getcomposer.org
[mini-mezzio]: https://github.com/asgrim/mini-mezzio
[php]: https://php.net
[sendgrid-send-email-response-documentation]: https://www.twilio.com/docs/sendgrid/api-reference/how-to-use-the-sendgrid-v3-api/responses
[send-email-sendgrid-docs]: https://www.twilio.com/docs/sendgrid/for-developers/sending-email/quickstart-php#complete-code-block
[sendgrid-create-api-key]: https://www.twilio.com/docs/sendgrid/ui/account-and-settings/api-keys#creating-an-api-key
[sendgrid-php-helper-library]: https://github.com/sendgrid/sendgrid-php