Download the PHP package frankspress/sg-parser-bundle without Composer
On this page you can find all versions of the php package frankspress/sg-parser-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download frankspress/sg-parser-bundle
More information about frankspress/sg-parser-bundle
Files in frankspress/sg-parser-bundle
Package sg-parser-bundle
Short Description Parses and validates SendGrid email content sent to the WebHook
License MIT
Informations about the package sg-parser-bundle
SgParserBundle
Parses and validates SendGrid email/attachments sent to the WebHook ( Symfony 5 )
Requirements
- PHP 7.1.3 or higher;
- Symfony 5.*.
Installation
Usage
Create a new route and set the prefix
to configure your new Webhook point.
Create a new EventSubscriber. This will automatically be called when a new email is sent to your Api point.
Default Config
To modify any of the default parameters create a config file and change any of the following.
For instance, if you want the bundle to allow only specific mime types then you can list them in mime_types
.
Basic Example
Methods are pretty much self explanatory. $email->getAttachments()
returns an array with the attachment titles not the actual attachments.
$attachments
comes as an array of attachments. From the example above you can see that for each attachment you can load its actual file with $attachment->getFile()
or get it's filename with $attachment->getFileName()
. One important note about $attachment->error()
, if this is empty the file has passed validation, if it's not empty then only the first encountered error will be recorded.
All versions of sg-parser-bundle with dependencies
symfony/validator Version 5.*
symfony/dependency-injection Version 5.*
symfony/event-dispatcher Version 5.*
symfony/yaml Version 5.0.*