aimeos / ai-swiftmailer
SwiftMailer adapter for Aimeos web shops and e-commerce solutions
Installs: 166 607
Dependents: 3
Suggesters: 0
Security: 0
Stars: 19
Watchers: 4
Forks: 5
Open Issues: 0
Type:aimeos-extension
Requires
- php: ~7.1||~8.0
- aimeos/aimeos-core: 2021.10.*
- swiftmailer/swiftmailer: ~5.0||~6.0
Requires (Dev)
- phpunit/phpunit: ~7.0||~8.0||~9.0
- dev-master
- 2022.01.x-dev
- 2021.10.x-dev
- 2021.10.2
- 2021.10.1
- 2021.07.x-dev
- 2021.07.1
- 2021.04.x-dev
- 2021.04.1
- 2021.01.x-dev
- 2020.10.x-dev
- 2020.10.2
- 2020.10.1
- 2020.07.x-dev
- 2020.07.1
- 2020.04.x-dev
- 2020.04.1
- 2020.01.x-dev
- 2020.01.1
- 2019.10.x-dev
- 2019.10.1
- 2019.07.x-dev
- 2019.07.1
- 2019.04.x-dev
- 2019.04.2
- 2019.04.1
- 2019.01.x-dev
- 2019.01.1
- 2018.10.x-dev
- 2018.10.2
- 2018.10.1
- 2018.07.x-dev
- 2018.07.1
- 2018.04.x-dev
- 2018.04.1
- 2018.01.x-dev
- 2018.01.5
- 2018.01.4
- 2018.01.3
- 2018.01.2
- 2018.01.1
- 2017.10.x-dev
- 2017.10.5
- 2017.10.4
- 2017.10.3
- 2017.10.2
- 2017.10.1
- 2017.07.x-dev
- 2017.07.2
- 2017.07.1
- 2017.04.x-dev
- 2017.04.2
- 2017.04.1
- 2017.03.x-dev
- 2017.02.x-dev
- 2017.01.x-dev
- 2017.01.2
- 2017.01.1
- 2016.10.x-dev
- 2016.10.2
- 2016.10.1
- 2016.07.x-dev
- 2016.07.2
- 2016.07.1
- 2016.04.x-dev
- 2016.04.1
- 2016.01.x-dev
- 2016.01.2
- 2016.01.1
- 2015.10.x-dev
- 2015.10.2
- 2015.10.1
- 2015.07.x-dev
- 2015.07.1
- 2015.03.x-dev
- 2015.03.1
- 2015.03.0
- dev-scrutinizer-patch-2
- dev-scrutinizer-patch-1
This package is auto-updated.
Last update: 2024-11-23 13:57:52 UTC
README
Aimeos Swiftmailer adapter
The Aimeos web shop components can integrate into almost any PHP application and uses the infrastructure of the application for building URLs, caching content, configuration settings, logging messages, session handling, sending e-mails or handling translations.
The ai-swiftmailer extension integrates the PHP Swiftmailer library for handling e-mails into Aimeos. It's required if your application uses Swiftmailer for sending e-mails and offers access to a Swiftmailer object that can be used together with this extension.
Table of content
Installation
To allow the Aimeos web shop components accessing the e-mail infrastructure of your own framework or application, you have to install the adapter first. As every Aimeos extension, the easiest way is to install it via composer. If you don't have composer installed yet, you can execute this string on the command line to download it:
php -r "readfile('https://getcomposer.org/installer');" | php -- --filename=composer
Add the ai-swiftmailer extension to the "require" section of your composer.json
file:
"require": [
"aimeos/ai-swiftmailer": "dev-master",
...
],
If you don't want to use the latest version, you can also install any release. The list of releases is available at Packagist. Afterwards you only need to execute the composer update command on the command line:
composer update
Setup
Now add the Swiftmailer object to the Aimeos context, which you have to create to get the Aimeos components running:
// $app is an object that can create the Swiftmailer object
$closure = function() use ( $app ) {
return $app->getSwiftMailer();
};
$mail = new MW_Mail_Swift( $closure );
$context->setMail( $mail );
Initializing and creating a Swiftmailer object is a resource intensive task. Therefore, it's best to avoid passing the Swiftmailer object directly to the MW_Mail_Swift
constructor (which is also possible) but to use a closure that can create the object on demand.
License
The Aimeos ai-swiftmailer extension is licensed under the terms of the LGPLv3 license and is available for free.