Separate mails for shop owner and customer - no bcc

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
boettner
Advanced
Posts: 136
Joined: 09 Feb 2015, 17:49

Re: Separate mails for shop owner and customer - no bcc

Post by boettner » 05 Aug 2020, 14:03

Try placing it in your "ai-html-client" ext directory from where all other custom classes/templates get called correctly. At the same level of the client directory:
custext.png
custext.png (12.29 KiB) Viewed 3380 times
From there: /lib/custom/src/MShop/Service/Provider/Delivery/Email.php

daniel
Posts: 28
Joined: 27 Jul 2020, 13:22

Re: Separate mails for shop owner and customer - no bcc

Post by daniel » 05 Aug 2020, 14:25

ok, so now i don't have the error any more.
In my Service for delivery i want to add the Decorator. But now it's in the "main"-list like "Standard" and "xml", see screenshot. I think it should be selectable under ("+"), not?
If i add "Email" (so i have "Standard,Email") in the frontend (checkout) i still got the error "Class "\Aimeos\MShop\Service\Provider\Decorator\Email" not available"
Sorry, i'm not a backend developer...
Attachments
Bildschirmfoto 2020-08-05 um 16.11.54.png
Bildschirmfoto 2020-08-05 um 16.11.54.png (13.81 KiB) Viewed 3379 times

boettner
Advanced
Posts: 136
Joined: 09 Feb 2015, 17:49

Re: Separate mails for shop owner and customer - no bcc

Post by boettner » 05 Aug 2020, 14:35

Did you maybe mix up class type and class location ?

Decorators go into: MShop\Service\Provider\Decorator
Provider into: MShop\Service\Provider\Decorator\Delivery (or ... Payment)

The classes must extend core classes respectively.

daniel
Posts: 28
Joined: 27 Jul 2020, 13:22

Re: Separate mails for shop owner and customer - no bcc

Post by daniel » 05 Aug 2020, 14:45

i think so... i'm a bit confused. I need an Email that goes to the shop owner if the scheduler task for order payment / order delivery is executed. I thought i need a Decorator for that... and i think now i have a provider...
It is not clear to me what i need, as the posts before i think i need a Decorator:
"You should write an "Email" decorator for the service providers that sends an e-mail to the configured address"
I will set back my changes to the point i had the selection of the Email Decorator.

boettner
Advanced
Posts: 136
Joined: 09 Feb 2015, 17:49

Re: Separate mails for shop owner and customer - no bcc

Post by boettner » 05 Aug 2020, 14:53

daniel wrote: 05 Aug 2020, 14:45 I will set back my changes to the point i had the selection of the Email Decorator.
Yes, and place it in the Decorator directory mentioned above and extend it like so:

Code: Select all

<?php

/**
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
 * @copyright Metaways Infosystems GmbH, 2011
 * @copyright Aimeos (aimeos.org), 2015-2018
 * @package MShop
 * @subpackage Service
 */


namespace Aimeos\MShop\Service\Provider\Decorator;


/**
 * Your Decorator 
 *
 * @package MShop
 * @subpackage Service
 */
class Email
    extends \Aimeos\MShop\Service\Provider\Decorator\Base
    implements \Aimeos\MShop\Service\Provider\Decorator\Iface
{
...
}

daniel
Posts: 28
Joined: 27 Jul 2020, 13:22

Re: Separate mails for shop owner and customer - no bcc

Post by daniel » 06 Aug 2020, 06:53

Good morning,
now i set it up and got no more errors. I add the Decorator to my Service type "delivery" > "Standard,Email".
But how this would be triggered when executing the scheduler task. I add a function "processBatch" (like recommended in previous post) where i output a log, but nothing happens (also tested with a die(); to stop executing), I think this would never be triggered...

boettner
Advanced
Posts: 136
Joined: 09 Feb 2015, 17:49

Re: Separate mails for shop owner and customer - no bcc

Post by boettner » 06 Aug 2020, 07:29

Good morning,
everything you are doing should be ok according to previous posts. You are working in a TER installation, right? Meaning not in composer mode? Do you see your class included in typo3conf/autoload/autoload_classmap.php?

As I didn´t do my own implementation yet, I unfortunately can´t offer any blueprint atm.

daniel
Posts: 28
Joined: 27 Jul 2020, 13:22

Re: Separate mails for shop owner and customer - no bcc

Post by daniel » 06 Aug 2020, 08:00

yes, TYPO3 10 with actual version of the aimeos ext form ter.
no, in the autoload_classmap.php it's not included, i only found Email.php file for
'Aimeos\\Aimeos\\Scheduler\\Provider\\Email' => $typo3InstallDir .typo3conf/ext/aimeos/Classes/Scheduler/Provider/Email.php',
'Aimeos\\Aimeos\\Scheduler\\Provider\\Email6' => $typo3InstallDir . 'typo3conf/ext/aimeos/Classes/Scheduler/Provider/Email6.php',

But also the other (default from aimeos ext) decorators are not in the autoload_classmap.php, is it neccessary that my class is included?

i checked the files in aimeos ext where the emails for payment are sent: ai-client-html/controller/jobs/src/Controller/Jobs/Order/Email/Payment/Standard.php
for delivery: ai-client-html/controller/jobs/src/Controller/Jobs/Order/Email/Delivery/Standard.php
maybe i should overwrite one of these if it's possible?

boettner
Advanced
Posts: 136
Joined: 09 Feb 2015, 17:49

Re: Separate mails for shop owner and customer - no bcc

Post by boettner » 06 Aug 2020, 08:12

Did you rebuild/dump the autoload information from the BE Maintenance module and clear the caches afterwards?

daniel
Posts: 28
Joined: 27 Jul 2020, 13:22

Re: Separate mails for shop owner and customer - no bcc

Post by daniel » 06 Aug 2020, 09:00

yes, sure. i don't think this should be in autoload_classmap, other decorators (from aimeos shop) are also not included.

Post Reply