RefundPlugin icon indicating copy to clipboard operation
RefundPlugin copied to clipboard

Inject more parameters in email template

Open adpeyre opened this issue 3 years ago • 3 comments

Q A
Branch? 1.2 (bug fixes, improvements)
Bug fix? no
New feature? yes

Inject more parameters like other sylius e-mails (ex https://docs.sylius.com/en/latest/book/architecture/emails.html#shipment-confirmation)

adpeyre avatar Jun 16 '22 12:06 adpeyre

Hi @adpeyre, thank you very much for your contribution. However, the change you propose doesn't really change anything, because the CreditMemo we provide to parameters already has all this information and can be used in the template.

Because of that, I'm closing this PR 🖖🏻 Of course, feel free to open other issues/PRs or answer here, if I don't see something 😃

GSadee avatar Jun 23 '22 09:06 GSadee

Hi @GSadee Yes, I agree with you, these informations can be retrieved from the CreditMemo object but it's a problem if I want to use the Sylius Core email layout as all other (Sylius) emails. It needs the localCode and the channel variables for generating right URLs.

https://github.com/Sylius/Sylius/blob/master/src/Sylius/Bundle/CoreBundle/Resources/views/Email/layout.html.twig

adpeyre avatar Jun 23 '22 16:06 adpeyre

@adpeyre thank for your quick answer, now, I see a small benefit of this change and it is ok for me, but you need to adjust the test: CreditMemoEmailSenderSpec. Can you do that? 😃

GSadee avatar Jun 24 '22 11:06 GSadee