From 06bc5b0d8160a6dbb0163eaff8b65fdf2540df9b Mon Sep 17 00:00:00 2001 From: bach Date: Mon, 9 Aug 2021 07:30:21 +0200 Subject: [PATCH] generale email sending by swiftmail, simplenews by mailgun (mailgun deos not work yet) --- composer.json | 1 + composer.lock | 198 +++++++++++++++++++++++++- config/sync/core.extension.yml | 1 + config/sync/mailgun.settings.yml | 4 +- config/sync/mailsystem.settings.yml | 13 +- config/sync/simplenews.settings.yml | 4 +- config/sync/swiftmailer.message.yml | 6 + config/sync/swiftmailer.transport.yml | 17 +++ 8 files changed, 237 insertions(+), 7 deletions(-) create mode 100644 config/sync/swiftmailer.message.yml create mode 100644 config/sync/swiftmailer.transport.yml diff --git a/composer.json b/composer.json index 9b9c036..23b21dd 100644 --- a/composer.json +++ b/composer.json @@ -92,6 +92,7 @@ "drupal/strings_i18n_json_export": "1.x-dev@dev", "drupal/structure_sync": "^2.0", "drupal/subrequests": "^2.0", + "drupal/swiftmailer": "2.x-dev@dev", "drupal/synonyms": "2.0.0-beta2", "drupal/telephone_formatter": "^1.0@beta", "drupal/telephone_validation": "^2.1", diff --git a/composer.lock b/composer.lock index 87eebfd..c4d4cca 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ddb11e35878184a0fddfa13339d0ab9b", + "content-hash": "321e22b9f4eb047ad2f3f49ca594deaf", "packages": [ { "name": "alchemy/zippy", @@ -12498,6 +12498,73 @@ "source": "https://git.drupalcode.org/project/subrequests" } }, + { + "name": "drupal/swiftmailer", + "version": "dev-2.x", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/swiftmailer.git", + "reference": "a4e6c414dbd153ce12a6a5f901e93c95f7705723" + }, + "require": { + "drupal/core": "^8.9.11 || ^9.0.10", + "drupal/mailsystem": "^4.1.0", + "egulias/email-validator": "^2.0", + "html2text/html2text": "^4.0.1", + "php": ">=7.0.0", + "swiftmailer/swiftmailer": "^6.1.3", + "tijsverkoyen/css-to-inline-styles": "^2.2" + }, + "type": "drupal-module", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + }, + "drupal": { + "version": "8.x-2.0-beta1+5-dev", + "datestamp": "1609578937", + "security-coverage": { + "status": "not-covered", + "message": "Dev releases are not covered by Drupal security advisories." + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "AdamPS", + "homepage": "https://www.drupal.org/user/2650563" + }, + { + "name": "Anybody", + "homepage": "https://www.drupal.org/user/291091" + }, + { + "name": "B-Prod", + "homepage": "https://www.drupal.org/user/407852" + }, + { + "name": "geek-merlin", + "homepage": "https://www.drupal.org/user/229048" + }, + { + "name": "sbrattla", + "homepage": "https://www.drupal.org/user/53422" + }, + { + "name": "webflo", + "homepage": "https://www.drupal.org/user/254778" + } + ], + "description": "Swiftmailer", + "homepage": "https://www.drupal.org/project/swiftmailer", + "support": { + "source": "https://git.drupalcode.org/project/swiftmailer" + } + }, { "name": "drupal/synonyms", "version": "2.0.0-beta2", @@ -17600,6 +17667,81 @@ }, "time": "2021-07-09T20:01:03+00:00" }, + { + "name": "swiftmailer/swiftmailer", + "version": "v6.2.7", + "source": { + "type": "git", + "url": "https://github.com/swiftmailer/swiftmailer.git", + "reference": "15f7faf8508e04471f666633addacf54c0ab5933" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/15f7faf8508e04471f666633addacf54c0ab5933", + "reference": "15f7faf8508e04471f666633addacf54c0ab5933", + "shasum": "" + }, + "require": { + "egulias/email-validator": "^2.0|^3.1", + "php": ">=7.0.0", + "symfony/polyfill-iconv": "^1.0", + "symfony/polyfill-intl-idn": "^1.10", + "symfony/polyfill-mbstring": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "symfony/phpunit-bridge": "^4.4|^5.0" + }, + "suggest": { + "ext-intl": "Needed to support internationalized email addresses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.2-dev" + } + }, + "autoload": { + "files": [ + "lib/swift_required.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Corbyn" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Swiftmailer, free feature-rich PHP mailer", + "homepage": "https://swiftmailer.symfony.com", + "keywords": [ + "email", + "mail", + "mailer" + ], + "support": { + "issues": "https://github.com/swiftmailer/swiftmailer/issues", + "source": "https://github.com/swiftmailer/swiftmailer/tree/v6.2.7" + }, + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/swiftmailer/swiftmailer", + "type": "tidelift" + } + ], + "time": "2021-03-09T12:30:35+00:00" + }, { "name": "symfony-cmf/routing", "version": "1.4.1", @@ -20245,6 +20387,59 @@ ], "time": "2020-02-14T14:20:12+00:00" }, + { + "name": "tijsverkoyen/css-to-inline-styles", + "version": "2.2.3", + "source": { + "type": "git", + "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", + "reference": "b43b05cf43c1b6d849478965062b6ef73e223bb5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/b43b05cf43c1b6d849478965062b6ef73e223bb5", + "reference": "b43b05cf43c1b6d849478965062b6ef73e223bb5", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "php": "^5.5 || ^7.0 || ^8.0", + "symfony/css-selector": "^2.7 || ^3.0 || ^4.0 || ^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^7.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "TijsVerkoyen\\CssToInlineStyles\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Tijs Verkoyen", + "email": "css_to_inline_styles@verkoyen.eu", + "role": "Developer" + } + ], + "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", + "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", + "support": { + "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", + "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/2.2.3" + }, + "time": "2020-07-13T06:12:54+00:00" + }, { "name": "tubalmartin/cssmin", "version": "v4.1.1", @@ -20906,6 +21101,7 @@ "drupal/select_translation": 20, "drupal/simplenews": 10, "drupal/strings_i18n_json_export": 20, + "drupal/swiftmailer": 20, "drupal/telephone_formatter": 10, "drupal/term_reference_tree": 20, "drupal/translate_side_by_side": 20, diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index 8ef6c5a..0ee788b 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -183,6 +183,7 @@ module: string_translation_ui: 0 strings_i18n_json_export: 0 structure_sync: 0 + swiftmailer: 0 synonyms: 0 synonyms_autocomplete: 0 synonyms_list_field: 0 diff --git a/config/sync/mailgun.settings.yml b/config/sync/mailgun.settings.yml index c5a5dc3..9948175 100644 --- a/config/sync/mailgun.settings.yml +++ b/config/sync/mailgun.settings.yml @@ -1,6 +1,6 @@ api_key: key-33300563658e8ae366a01cb603a9fef8 -working_domain: materio.com -debug_mode: false +working_domain: _sender +debug_mode: true test_mode: false tracking_opens: 'yes' tracking_clicks: 'yes' diff --git a/config/sync/mailsystem.settings.yml b/config/sync/mailsystem.settings.yml index 23c83f7..cf49a99 100644 --- a/config/sync/mailsystem.settings.yml +++ b/config/sync/mailsystem.settings.yml @@ -1,6 +1,15 @@ theme: materiotheme defaults: - sender: mailgun_queue_mail - formatter: php_mail + sender: swiftmailer + formatter: swiftmailer _core: default_config_hash: IhwTepsVwtbtbcT5GzQKhCXDCRvbk3MNkWqPiuiZ10s +modules: + swiftmailer: + none: + formatter: swiftmailer + sender: swiftmailer + simplenews: + none: + formatter: swiftmailer + sender: mailgun_queue_mail diff --git a/config/sync/simplenews.settings.yml b/config/sync/simplenews.settings.yml index 678fd11..6554155 100644 --- a/config/sync/simplenews.settings.yml +++ b/config/sync/simplenews.settings.yml @@ -26,9 +26,9 @@ subscription: tidy_unconfirmed: 0 mail: use_cron: true - throttle: 20 + throttle: 200 spool_progress_expiration: 3600 - spool_expire: 0 + spool_expire: 1 debug: true source_cache: null _core: diff --git a/config/sync/swiftmailer.message.yml b/config/sync/swiftmailer.message.yml new file mode 100644 index 0000000..e7b3b8d --- /dev/null +++ b/config/sync/swiftmailer.message.yml @@ -0,0 +1,6 @@ +content_type: text/html +text_format: '' +generate_plain: true +character_set: UTF-8 +_core: + default_config_hash: VMWxVURttskghCbo5AuwZeaD2NJquuMGrOMJqG1YZhE diff --git a/config/sync/swiftmailer.transport.yml b/config/sync/swiftmailer.transport.yml new file mode 100644 index 0000000..0880ce7 --- /dev/null +++ b/config/sync/swiftmailer.transport.yml @@ -0,0 +1,17 @@ +transport: sendmail +smtp_host: 127.0.0.1 +smtp_port: 25 +smtp_encryption: '' +smtp_credential_provider: swiftmailer +smtp_credentials: + swiftmailer: + username: '' + password: '' + key: + username: '' + password: '' +sendmail_path: /usr/sbin/sendmail +sendmail_mode: bs +spool_directory: '' +_core: + default_config_hash: RSNbRD3ekSaZoE19f3eHhm93gKOcD2PtmaAVmV3XMes