onethirtyone / aws-s3-mime-handler
A Laravel Package to parse AWS SES messages from an S3 Bucket
Requires
Requires (Dev)
- orchestra/testbench: ^5.1
- phpunit/phpunit: ^8.5
Suggests
- onethirtyone/aws-sns-handler: Validate and handle incoming SNS messages
This package is auto-updated.
Last update: 2025-03-06 22:44:52 UTC
README
Fetch and parse MIME messages from your Amazon S3 bucket.
Installation
Require the package with composer.
composer require onethirtyone/aws-s3-mime-handler
You'll also need to make sure your AWS environment variables are set
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=
AWS_BUCKET=
Usage
The MessageCollector
facade will return a collection of OneThirtyOne\Mime\Message
instances. Each of these instances is a fully parsed MIME message from your bucket. You can access the properties:
MessageCollector::fromBucket()->each(function ($message) { $message->id; // The message file name $message->to; // Message recipient $message->from; // Message Sender $message->subject; // Message Subject $message->body; // The body of the message (plain text) });
You can delete a message by calling the delete()
method on a message object
$message = MessageCollector::fromBucket()->first(); $message->delete();
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change
Please make sure to update tests as appropriate.