Adapt EMails in Typo3 with AimeosExtension

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
DrDickGind
Posts: 11
Joined: 21 Dec 2016, 10:22

Adapt EMails in Typo3 with AimeosExtension

Post by DrDickGind » 21 Dec 2016, 10:32

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 ;)

DrDickGind
Posts: 11
Joined: 21 Dec 2016, 10:22

Re: Adapt EMails in Typo3 with AimeosExtension

Post by DrDickGind » 21 Dec 2016, 10:36

btw.: I am using Typo3 7.6.14, Aimeos 16.10.2 and PHP 7.0.10 CGI

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Adapt EMails in Typo3 with AimeosExtension

Post by aimeos » 22 Dec 2016, 16:07

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
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

DrDickGind
Posts: 11
Joined: 21 Dec 2016, 10:22

Re: Adapt EMails in Typo3 with AimeosExtension

Post by DrDickGind » 16 Jan 2017, 13:35

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.

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Adapt EMails in Typo3 with AimeosExtension

Post by aimeos » 16 Jan 2017, 15:28

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

DrDickGind
Posts: 11
Joined: 21 Dec 2016, 10:22

Re: Adapt EMails in Typo3 with AimeosExtension

Post by DrDickGind » 18 Jan 2017, 15:41

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

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Adapt EMails in Typo3 with AimeosExtension

Post by aimeos » 19 Jan 2017, 15:15

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

DrDickGind
Posts: 11
Joined: 21 Dec 2016, 10:22

Re: Adapt EMails in Typo3 with AimeosExtension

Post by DrDickGind » 19 Jan 2017, 15:44

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 :-)

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Adapt EMails in Typo3 with AimeosExtension

Post by aimeos » 20 Jan 2017, 12:38

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
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

DrDickGind
Posts: 11
Joined: 21 Dec 2016, 10:22

Re: Adapt EMails in Typo3 with AimeosExtension

Post by DrDickGind » 20 Jan 2017, 14:01

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 ;)

Post Reply