Sending an email to each supplier
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 4
- Joined: 01 Jul 2019, 14:40
Sending an email to each supplier
Hello, I would like to send an email to the suppliers of the items at the end of the payment process, containing the list of items, the supplier reference and the customer's contact details.
I'm a little lost in the way email works, if you can explain to me the steps to follow or the files to complete, it would be very nice of you.
I am under version 2018.10.
Laravel : 5.8.
Thank you in advance.
Sincerely BORNAND Alexandre.
I'm a little lost in the way email works, if you can explain to me the steps to follow or the files to complete, it would be very nice of you.
I am under version 2018.10.
Laravel : 5.8.
Thank you in advance.
Sincerely BORNAND Alexandre.
Re: Sending an email to each supplier
Create a delivery service decorator that is called when you execute the order/export/delivery job using
It's documented there: https://aimeos.org/docs/Developers/Library/Service esp. https://aimeos.org/docs/Developers/Libr ... _decorator
For sending an e-mail, you can retrieve the mailer instance by
This instance has the following API:
- https://github.com/aimeos/aimeos-core/b ... /Iface.php
- https://github.com/aimeos/aimeos-core/b ... /Iface.php
Code: Select all
./artisan aimeos:jobs order/export/delivery
For sending an e-mail, you can retrieve the mailer instance by
Code: Select all
$this->getContext()->getMail()
- https://github.com/aimeos/aimeos-core/b ... /Iface.php
- https://github.com/aimeos/aimeos-core/b ... /Iface.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 4
- Joined: 01 Jul 2019, 14:40
Re: Sending an email to each supplier
Hello, after 1 month of trying, I can't develop this mail module...
Is it possible to have a little more precision?
I created a provider in: "ext/.../lib/custom/src/MShop/Service/Provider/Delivery/Myprovider.php"
I followed the documentation and added the recovery of items....
But I don't understand how to retrieve the email from the inventory, nor don't understand I send an email.
Sorry for my ignorance, I have to return this project in 1 month and I would really like this feature to work.
Is it possible to have a little more precision?
I created a provider in: "ext/.../lib/custom/src/MShop/Service/Provider/Delivery/Myprovider.php"
I followed the documentation and added the recovery of items....
But I don't understand how to retrieve the email from the inventory, nor don't understand I send an email.
Sorry for my ignorance, I have to return this project in 1 month and I would really like this feature to work.
Re: Sending an email to each supplier
Maybe the Aimeos company can help you to get it implemented:
https://aimeos.com/aimeos-gmbh/contact
https://aimeos.com/aimeos-gmbh/contact
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 4
- Joined: 01 Jul 2019, 14:40
Re: Sending an email to each supplier
Seriously?
I'll manage, thanks anyway.
I'll manage, thanks anyway.
Re: Sending an email to each supplier
Sending emails is pretty obvious when you look at the interfaces:
You can get the suppliercode from each product in the service provider with:
Retrieve the supplier e-mail:
Additionally, you only have to pass the supplier code in the frontend when a customer adds a product to the basket.
Code: Select all
$mailer = $this->getContext()->getMail();
$msg = $mailer->createMessage();
$msg->setSender( '<email>' )->addTo( '<email>' )
->setSubject( 'test' )->setBody( 'message' );
$mailer->send( $msg );
Code: Select all
$basket = $this->getOrderBase( $order->getBaseId(), \Aimeos\MShop\Order\Item\Base\Base::PARTS_PRODUCT );
foreach( $basket->getProducts() as $product ) {
$suppliercode = $product->getSupplierCode();
}
Code: Select all
$manager = \Aimeos\MShop::create( $this->getContext(), 'supplier' );
$email = $manager->findItem( $suppliercode )->getEmail();
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star