Plugin for commerce ticketing module

Created on 22 January 2024, 10 months ago
Updated 29 February 2024, 9 months ago

Problem/Motivation

I proposed the new emailbuilder plugin for commerce ticketing, it could be found in the issue: https://www.drupal.org/project/commerce_ticketing/issues/3416185 Symfony mailer plugin Needs review
I have some questions to help improve the plugin:

  • Is there a way to add the token popup helper and explain the available specific twig variables for this policy?
  • When I import the policies it always create the All >> All , the policy works, but is not importing for the given subtype and bundle( the same is happening with commerce order type). I thought that this was the aim of the entity bundles iteration in the for loop in import method of the plugin in https://git.drupalcode.org/project/commerce_ticketing/-/blob/63e532d1607... .
  • This policy also attaches a pdf coming from entity_print, and the only way I found to use the theme specified in symfony mailer is switching the active theme before creating the pdf and switching back again when it's done. It will help the merging of this issue: https://www.drupal.org/project/entity_print/issues/2860122 Add option to set theme used for entity_print rendering Needs work , but by now it's undecided if it will be merged, so it's the way that I end up using. Do you think it's ok?
  • Finally the old class was switching the account https://git.drupalcode.org/project/commerce_ticketing/-/blob/2.x/src/Mai... to prevent empty pdf. But I think that is not needed when using symfony mailer, true?

Thank's and sorry to aggregate the questions, if you need an issue for each one I'll re-post it.

💬 Support request
Status

Fixed

Version

1.4

Component

Code

Created by

🇪🇸Spain aleix

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

Comments & Activities

  • Issue created by @aleix
  • 🇬🇧United Kingdom adamps

    > Is there a way to add the token popup helper and explain the available specific twig variables for this policy?

    Not yet but there are open feature requests for both.

    > When I import the policies it always create the All >> All , the policy works, but is not importing for the given subtype and bundle( the same is happening with commerce order type). I thought that this was the aim of the entity bundles iteration in the for loop in import method of the plugin in https://git.drupalcode.org/project/commerce_ticketing/-/blob/63e532d1607... .

    That could be a bug. However the import will not create a policy if it would have no effect (is identical to the parent policy), which is by design.

    > This policy also attaches a pdf coming from entity_print, and the only way I found to use the theme specified in symfony mailer is switching the active theme before creating the pdf and switching back again when it's done. It will help the merging of this issue: https://www.drupal.org/project/entity_print/issues/2860122 Add option to set theme used for entity_print rendering Needs work , but by now it's undecided if it will be merged, so it's the way that I end up using. Do you think it's ok?

    It's not really right as another module might alter the theme after your code has run. Instead could you do this in the preRender() callback when the theme has been set already?

    > Finally the old class was switching the account https://git.drupalcode.org/project/commerce_ticketing/-/blob/2.x/src/Mai... to prevent empty pdf. But I think that is not needed when using symfony mailer, true?

    This module will automatically switch account after the build phase.

  • Status changed to Fixed 9 months ago
  • 🇬🇧United Kingdom adamps
  • 🇪🇸Spain aleix

    Great! Thank's.
    I am just writing to let you know that your tips worked and plugin is much cleaner right now. I hope that it will be merged.

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

Production build 0.71.5 2024