We're including Symfony Mailer in Commerce Kickstart in addition to just generally recommending it in all of our projects. Recently, you added a email_html filter format. However, due to the way dependencies for modules and configuration import are resolved, this prevents our installation profile from installing. The error message / screenshot were originally reported in #3275136: Installation fails on a Symfony Mailer configuration dependency issue.

The reason for this is that configuration file depends on the Filter module, but the module does not enforce such a dependency. Since Filter is not installed yet during the installation process when these dependencies are being resolved, the installer fails. There are two options:

  1. Move the configuration file to config/optional instead of config/install.
  2. Add a dependency in symfony_mailer.info.yml on drupal:filter.

I don't know the module well enough to judge your intent, but I've tested both of those approaches and I ultimately was able to install fine. Filter gets installed early enough that the optional config installation did not fail, and of course adding it as a dependency in the .info.yml led to proper resolution / installation.

CommentFileSizeAuthor
#2 3275333-2.filter_dependencey.patch345 bytesrszrama

Comments

rszrama created an issue. See original summary.

rszrama’s picture

Status: Active » Needs review
StatusFileSize
new345 bytes

Filter is such a fundamental module in Drupal that I'm adding a patch here to take approach #2, add the dependency to Symfony Mailer, because this is an easy enough patch for me to include in Commerce Kickstart for now. Feel free to go with approach #1, though - I don't know what's ultimately best for you. 😊

(Edit: lol @ the filename typo. C'est la vie.)

  • AdamPS committed 4d00751 on 1.x authored by rszrama
    Issue #3275333 by rszrama: New email_html format should be optional or...
adamps’s picture

Status: Needs review » Fixed

Thanks. I agree with approach #2.

It's interesting that you are considering this module for Commerce Kickstart. I was going to reach out to you at Commerce Guys soon - I was just waiting for the module to become a bit more stable.

Currently the integration with commerce is fairly limited, see:

  1. docs
  2. Code in CommerceEmailBuilder. The @todo comment at the top of the file discusses some options for deeper integration.
  3. Specific issue #3271421: Full integration with commerce module. However I can't see any way to get the required information - the email is already built.

I am maintainer of simplenews and I am exploring a native integration with Symfony Mailer - i.e. simplenews calls the Symfony Mailer API directly. There is a working patch on #3275129: Use Symfony Mailer API to send mails and it allows removal of 2000 lines of code from simplenews!

I would be happy to discuss options for a closer integration it you are interested.

rszrama’s picture

Oh, cool! Yep, we've long used Swift Mailer but started replacing it in our projects and documentation with reference to Symfony Mailer instead. 😄

Re: increasing support for Commerce in the Symfony Mailer module directly, happy to take a look! Thus far I'd mostly confined my efforts to Commerce Email, but there we were more concerned about the triggering of emails with basic token replacement in the parameters than improving the Twig integration. (I heard from another community member of a separate module for that but hadn't had a chance to review.)

Will share the above issue in our internal channel, too.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.