Page 1 of 1

Adapt EMails in Typo3 with AimeosExtension

Posted: 21 Dec 2016, 10:32
by DrDickGind
Hi,

I try to adapt some delivery and payment Emails with my created Aimeos Extension. I can overwrite with this extension everything, but not the Email-Templates. So I read in this Forum, that you have to add TypoScript in the Scheduler Task. So i added this line:

Code: Select all

plugin.tx_aimeos.settings.client.html.email.payment.html.standard.template-body {
   0 = /www/htdocs/w010525e/update.schwabenpark.de/typo3conf/ext/schwabenpark_shop/Resources/Private/Extensions/schwabenpark_shop/client/html/templates/email/payment/6/html-intro-body-default.php
} 
My Problem is, that this Template is now used for every payment-status. But I only want to change the Email for payment-status 6. How can I do this with my Extension. Or do i have to edit the original Aimeos Email-Templates?

Thanks for Help ;)

Re: Adapt EMails in Typo3 with AimeosExtension

Posted: 21 Dec 2016, 10:36
by DrDickGind
btw.: I am using Typo3 7.6.14, Aimeos 16.10.2 and PHP 7.0.10 CGI

Re: Adapt EMails in Typo3 with AimeosExtension

Posted: 22 Dec 2016, 16:07
by aimeos
You only need that configuration if you want to use a differently named template. In all other cases, you can simply create a new template with the same name. The reason why you didn't notice any change was that you've changed the wrong template. Please have a look into the subdirectories where the "intro" templates for specific payment status are stored: https://github.com/aimeos/ai-client-htm ... il/payment

You can find the list of available payment status values here:
https://github.com/aimeos/aimeos-core/b ... e.php#L105

Re: Adapt EMails in Typo3 with AimeosExtension

Posted: 16 Jan 2017, 13:35
by DrDickGind
Hi there,

thanks for the answer, but I can not get this to work. You said i changed the wrong template. So is this path somewhere wrong?

Code: Select all

typo3conf/ext/schwabenpark_shop/Resources/Private/Extensions/schwabenpark_shop/client/html/templates/email/payment/6/html-intro-body-default.php
My Aimeos Extension is working fine. So i can overwrite for example the basket body

Code: Select all

typo3conf/ext/schwabenpark_shop/Resources/Private/Extensions/schwabenpark_shop/client/html/templates/basket/standard/body-default.php
Sorry but i dont know whats wrong.

Re: Adapt EMails in Typo3 with AimeosExtension

Posted: 16 Jan 2017, 15:28
by aimeos
DrDickGind wrote:

Code: Select all

typo3conf/ext/schwabenpark_shop/Resources/Private/Extensions/schwabenpark_shop/client/html/templates/email/payment/6/html-intro-body-default.php
That's the right template and you now have to remove the configuration you've added in the scheduler task.
The reason behind is that by using the configuration "plugin.tx_aimeos.settings.client.html.email.payment.html.standard.template-body", you are effectively set your template for all payment status values which isn't what you want. Without this configuration, the template for the actual payment status is chosen.

Re: Adapt EMails in Typo3 with AimeosExtension

Posted: 18 Jan 2017, 15:41
by DrDickGind
Hi thanks for the answer.

Yes i have removed my TypoScript config from the Scheduler Aimeos Email Task, and the Problem like I said in my first post still exists: The Scheduler Task for Emails is not using the Extensions Templates but the original ones... Any Ideas?

Thanks

Re: Adapt EMails in Typo3 with AimeosExtension

Posted: 19 Jan 2017, 15:15
by aimeos
Could you please add the "ai-client-html" line to the schwabenpark_shop/manifest.php:

Code: Select all

	'depends' => array(
		'aimeos-core',
		'ai-client-html',
	),
I guess it's the missing dependency that causes the original template to be used in that case.

Re: Adapt EMails in Typo3 with AimeosExtension

Posted: 19 Jan 2017, 15:44
by DrDickGind
Hi aimeos,

You were right, the ai-client-html was missing in the manifest.php. Ich changed it, cleared all cache in the installtool and no luck...

Today I wanted to override Standard.php in client/html/src/Client/Html/Checkout/Standard/Summary/Option/ also this didnt work. Or I am not supposed to override things in the src dir with my extension? May something in my extension is broken?

As always thank you :-)

Re: Adapt EMails in Typo3 with AimeosExtension

Posted: 20 Jan 2017, 12:38
by aimeos
We've found another potential problem for overwriting the e-mail templates. Could you please add the "client/html/templates" line to the schwabenpark_shop/manifest.php:

Code: Select all

		'controller/jobs/templates' => array(
			'controller/jobs/templates',
			'client/html/templates',
		),
If that fixes the problem, we will update the extension generator on the aimeos.org website.

Regarding classes, no it doesn't work that way. You can only overwrite templates. Classes must be extended in an OOP way and the name of the new class configured. In your case you have to use:
https://aimeos.org/docs/Configuration/C ... ption/name

Re: Adapt EMails in Typo3 with AimeosExtension

Posted: 20 Jan 2017, 14:01
by DrDickGind
Hi aimeos,

A big thanks to you, i added the "client/html/templates" line, as you mentioned and now everything work as expected :D
This 'Bug' was too hard to find for me :roll: . So please update your extension generator on aimeos.org.

Many thanks ;)