Page 1 of 1

send "csv import"-report by mail?

Posted: 07 Feb 2020, 11:20
by columbo
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

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

Posted: 08 Feb 2020, 09:07
by aimeos
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 );

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

Posted: 08 Feb 2020, 13:03
by aimeos
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