send "csv import"-report by mail?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
columbo
Posts: 31
Joined: 09 Oct 2019, 09:42

send "csv import"-report by mail?

Post by columbo » 07 Feb 2020, 11:20

Hi,

is it possible to receive a "csv import"-report send by email?
My products are updated daily using the csv import job.
It would be great if a report with the successful / failed imports would be sent by mail. - Is there already a way to do this?

Thanks

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

Re: send "csv import"-report by mail?

Post by aimeos » 08 Feb 2020, 09:07

You could extend e.g. the product CSV importer (extend from the Standard class, configure your new class name) and send an e-mail here:
https://github.com/aimeos/ai-controller ... #L368-L375

Code: Select all

$mailer = $this->getContext()->getMail();
$message = $mailer->createMessage()->setSubject( 'Export' )->setBody( $msg )
	->setSender( 'me@localhost' )->addTo( 'someone@example.com' );
$mailer->send( $message );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

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

Re: send "csv import"-report by mail?

Post by aimeos » 08 Feb 2020, 13:03

The 2020.04 version will send e-mails for failed imports automatically if you configure a recipient e-mail address:
- https://github.com/aimeos/ai-controller ... 2790931a26
- https://github.com/aimeos/aimeos-core/c ... 6R100-R112
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply