flowmailer / symfony-flowmailer-mailer
Provides Flowmailer integration for Symfony Mailer
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
Open Issues: 0
Type:symfony-mailer-bridge
Requires
- php: ^8.1
- flowmailer/flowmailer-php-sdk: *
- nyholm/psr7: *
- symfony/http-client: *
- symfony/mailer: ^6.0
Requires (Dev)
- ergebnis/composer-normalize: ^2.21
- friendsofphp/php-cs-fixer: ^3.4
- icanhazstring/composer-unused: ^0.7.11
- maglnet/composer-require-checker: ^3.8
- nyholm/symfony-bundle-test: ^1.8
- phpstan/phpstan: ^1.2
- phpunit/phpunit: ^9.5
- symfony/console: ^5.4 || ^6.0
README
Provides Flowmailer integration for Symfony Mailer.
Installation
composer require flowmailer/symfony-flowmailer-mailer
Configuration
Obtain credentials from Flowmailer credentials wizard
Add the obtained credentials to the MAILER_DSN in the env file:
MAILER_DSN=flowmailer://CLIENT_ID:CLIENT_SECRET@api.flowmailer.net?account_id=1234
When using in a symfony project, you'll need to tag the transport factory as a 'mailer.transport_factory'.
# config/services.yaml services: # Other services Flowmailer\Symfony\Mailer\Transport\FlowmailerTransportFactory: parent: 'mailer.transport_factory.abstract' tags: - name: 'mailer.transport_factory'
Stand alone:
use Symfony\Component\Mailer\Mailer; use Symfony\Component\Mailer\Transport; use Flowmailer\Symfony\Mailer\Transport\FlowmailerTransportFactory; $factory = new FlowmailerTransportFactory(); $transport = new Transport([$factory]); $mailer = new Mailer($transport->fromString($dsnString)); $email = (new Email()) ->from('example@example.com') ->to('example@example.com') ->subject('Test e-mail') ->text('This is the content of the email') ->html('<p>Test e-mail with inline image</p><img src="cid:inline-image">') ->attachFromPath('path/to/attachment.pdf') ->embedFromPath('path/to/inline-image.png', 'inline-image') ; $mailer->send($email);