Add possibility to attach PDF files to the e-mail

Created on 19 July 2024, 11 months ago
Updated 31 July 2024, 10 months ago

Problem/Motivation

Accoring to one of the selling companies we work with in Slovakia there's a new regulation where they must send the "terms and conditions" document in the Order confirmation and communication e-mails. Please add a possibility to add files from Commerce Store or Commerce Order fields in a format that could be sent with Symfony Mailer.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia kaszarobert

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @kaszarobert
  • Status changed to Needs review 10 months ago
  • πŸ‡ΈπŸ‡°Slovakia kaszarobert

    I wrote about our approach in a MR.

  • Pipeline finished with Success
    10 months ago
    Total: 133s
    #239479
  • πŸ‡«πŸ‡·France steveoriol Grenoble πŸ‡«πŸ‡·

    A get an error on "/admin/commerce/config/emails" page after add MR!25 :

    ArgumentCountError: Too few arguments to function Drupal\commerce_email\EmailSender::__construct(), 4 passed in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 261 and exactly 5 expected in Drupal\commerce_email\EmailSender->__construct() (line 77 of modules/contrib/commerce_email/src/EmailSender.php).

  • πŸ‡«πŸ‡·France steveoriol Grenoble πŸ‡«πŸ‡·

    By adding the create method inside the EmailSender class, this works:

    public static function create(ContainerInterface $container) {
      return new static(
        $container->get('commerce_email.mail_handler'),
        $container->get('token'),
        $container->get('database'),
        $container->get('entity_type.manager'),
        $container->get('event_dispatcher')
      );
    }
    
  • Pipeline finished with Failed
    30 days ago
    Total: 193s
    #493473
  • Pipeline finished with Failed
    30 days ago
    Total: 251s
    #493486
  • πŸ‡«πŸ‡·France steveoriol Grenoble πŸ‡«πŸ‡·

    In fact, this MR works really well, it's great.
    Do you think it would be easy to modify to be able to select several files in the list, for example a pdf of the order and another from the store?

Production build 0.71.5 2024