diff --git a/composer.json b/composer.json index 6c55ce0f..792922a6 100644 --- a/composer.json +++ b/composer.json @@ -156,7 +156,6 @@ "drupal/string_translation_ui": "^1.2", "drupal/strings_i18n_json_export": "^1.x-dev@dev", "drupal/structure_sync": "^2.0", - "drupal/swiftmailer": "^2.x-dev@dev", "drupal/symfony_mailer": "^1.0@alpha", "drupal/synonyms": "^2.0.0-beta2", "drupal/telephone_formatter": "^1.0@beta", diff --git a/composer.lock b/composer.lock index 1961be25..304e5294 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": "78f26bb64269c36ef8750454f9b8fbea", + "content-hash": "37949e67c842c709dfa915af08bb2925", "packages": [ { "name": "alchemy/zippy", @@ -13609,73 +13609,6 @@ "source": "https://git.drupalcode.org/project/structure_sync" } }, - { - "name": "drupal/swiftmailer", - "version": "dev-2.x", - "source": { - "type": "git", - "url": "https://git.drupalcode.org/project/swiftmailer.git", - "reference": "8dd88509d6da0adba532269aae0caad929f6a574" - }, - "require": { - "drupal/core": "^8.9.11 || ^9.0.10", - "drupal/mailsystem": "^4.1.0", - "egulias/email-validator": "^2.0||^3", - "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.1+1-dev", - "datestamp": "1639067975", - "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/symfony_mailer", "version": "1.0.0-alpha9", @@ -19476,82 +19409,6 @@ "installer-name": "svg-pan-zoom" } }, - { - "name": "swiftmailer/swiftmailer", - "version": "v6.3.0", - "source": { - "type": "git", - "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "8a5d5072dca8f48460fce2f4131fcc495eec654c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/8a5d5072dca8f48460fce2f4131fcc495eec654c", - "reference": "8a5d5072dca8f48460fce2f4131fcc495eec654c", - "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.4" - }, - "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.3.0" - }, - "funding": [ - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/swiftmailer/swiftmailer", - "type": "tidelift" - } - ], - "abandoned": "symfony/mailer", - "time": "2021-10-18T15:26:12+00:00" - }, { "name": "symfony-cmf/routing", "version": "2.3.4", @@ -25715,7 +25572,6 @@ "drupal/session_limit": 10, "drupal/simplenews": 20, "drupal/strings_i18n_json_export": 20, - "drupal/swiftmailer": 20, "drupal/symfony_mailer": 15, "drupal/telephone_formatter": 10, "drupal/translate_side_by_side": 20, diff --git a/config/sync/symfony_mailer.mailer_policy.simplenews.subscribe.yml b/config/sync/symfony_mailer.mailer_policy.simplenews.subscribe.yml index 88256000..0ec12d27 100644 --- a/config/sync/symfony_mailer.mailer_policy.simplenews.subscribe.yml +++ b/config/sync/symfony_mailer.mailer_policy.simplenews.subscribe.yml @@ -8,11 +8,14 @@ _core: default_config_hash: eS_mn5V1pRFDUx66hVOesANK1KjPtyMQBr8v0JEBp-A id: simplenews.subscribe configuration: - email_subject: - value: 'Confirmation for [site:name]' + email_from: + addresses: + - + value: news@materio.com + display: '' email_body: content: - value: |- -

We have received a request to subscribe [simplenews-subscriber:mail] at [site:name]. - Please use this link to confirm your subscribtion.

+ value: "

We have received a request to subscribe [simplenews-subscriber:mail] at [site:name].\r\nPlease use this link to confirm your subscribtion.

" format: email_html + email_subject: + value: 'Confirmation for [site:name]' diff --git a/config/sync/symfony_mailer.mailer_policy.simplenews.validate.yml b/config/sync/symfony_mailer.mailer_policy.simplenews.validate.yml index 3d638d35..2092021c 100644 --- a/config/sync/symfony_mailer.mailer_policy.simplenews.validate.yml +++ b/config/sync/symfony_mailer.mailer_policy.simplenews.validate.yml @@ -8,11 +8,14 @@ _core: default_config_hash: 5Oh2xuv7tqN5i5bnfKD00U_BBPkar6m2je0uO0SQNc4 id: simplenews.validate configuration: - email_subject: - value: 'Manage your subscriptions at [site:name]' + email_from: + addresses: + - + value: news@materio.com + display: '' email_body: content: - value: |- -

We have received a request to manage your subscriptions for [simplenews-subscriber:mail] at [site:name]. - Please use this link to proceed.

+ value: "

We have received a request to manage your subscriptions for [simplenews-subscriber:mail] at [site:name].\r\nPlease use this link to proceed.

" format: email_html + email_subject: + value: 'Manage your subscriptions at [site:name]' diff --git a/config/sync/symfony_mailer.mailer_policy.simplenews_newsletter.yml b/config/sync/symfony_mailer.mailer_policy.simplenews_newsletter.yml index d7d5f6a8..6c7fe211 100644 --- a/config/sync/symfony_mailer.mailer_policy.simplenews_newsletter.yml +++ b/config/sync/symfony_mailer.mailer_policy.simplenews_newsletter.yml @@ -13,9 +13,5 @@ configuration: - value: news@materio.com display: '' - email_body: - content: - value: "
\r\n {{ body }}\r\n
\r\n\r\n{% if not opt_out_hidden %}\r\n

Unsubscribe from this newsletter

\r\n{% endif %}\r\n\r\n{% if test %}\r\n

This is a test version of the newsletter.

\r\n{% endif %}" - format: email_html email_subject: value: '[node:title]' diff --git a/web/themes/custom/materiotheme/templates/email-simplenews-newsletter.html.twig b/web/themes/custom/materiotheme/templates/email-simplenews-newsletter.html.twig new file mode 100644 index 00000000..117831f3 --- /dev/null +++ b/web/themes/custom/materiotheme/templates/email-simplenews-newsletter.html.twig @@ -0,0 +1,143 @@ +{# +/** + * @file + * Default theme implementation to format the simplenews newsletter body. + * + * Copy this file in your theme directory to create a custom themed body. + * Rename it to override it. Available templates: + * simplenews-newsletter-body--[newsletter_id].html.twig + * simplenews-newsletter-body--[view mode].html.twig + * simplenews-newsletter-body--[newsletter_id]--[view mode].html.twig + * See README.txt for more details. + * + * Available variables: + * - build: Render array. Use {{ build }} to print it. + * - node: object(Drupal\node\Entity\Node) + * The node entity with limited access to object properties and methods. + * * Methods: Only "getter" methods (method names starting with "get", "has", or "is") + * and a few common methods such as "id" and "label" are available. + * {{ node.getTitle }} : the Node title ( == {{ title }} ) + * Calling other methods (such as node.delete) will result in an exception. + * * Properties: field values can be accessed as follows: + * {{ node.body.value | raw }} : text of body field + * - newsletter: object(Drupal\simplenews\Entity\Newsletter) + * {{ newsletter.from_name }}: string + * {{ newsletter.subject }}: string + * - title: Node title + * - view_mode: The active display view mode of the node + * - key: email key [node|test] + * - format: newsletter format [plain|html] + * - simplenews_subscriber: object(Drupal\simplenews\Entity\Subscriber) + * The subscriber for which the newsletter is built. + * {{ simplenews_subscriber.getMail }}: string: subscriber's email address + * Note that depending on the used caching strategy, the generated body might + * be used for multiple subscribers. If you created personalized newsletters + * and can't use tokens for that, make sure to disable caching or write a + * custom caching strategy implemention. + * + * @see template_preprocess_simplenews_newsletter_body() + */ +#} + + + + + + + +
+ +

Voir la version en ligne / View this email on the web + + + + + + +
+ + {#

{{ title }}

#} + {{ build }} + + + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + + + +
+ + instagram + + + + youtube + + + + youtube + +
+
+
+
+
+
+ + + + + + +
+   +
+ +{% if not opt_out_hidden %} + {% if format == 'html' %} +

+ {% else %} + -- {{ unsubscribe_text }} : [simplenews-subscriber:unsubscribe-url] + {% endif %} +{% endif %} + +{% if key == 'test' %} + - - - {{ test_message }} - - - +{% endif %} + + +
\ No newline at end of file diff --git a/web/themes/custom/materiotheme/templates/email.html.twig b/web/themes/custom/materiotheme/templates/email.html.twig new file mode 100644 index 00000000..1e0535cb --- /dev/null +++ b/web/themes/custom/materiotheme/templates/email.html.twig @@ -0,0 +1,15 @@ +{# +/** + * @file + * Default theme implementation for Symfony Email. + * + * Variables: + * - body: Email body content. + * + * @see template_preprocess_email() + * + * @ingroup themeable + */ +#} + +{{ body }}