How can i send my EventObserver log message by whatsapp message?
@curtnorvalf534 As per technology everything possible the way of try may be different but everything possible, we did it, using Twilio API.
I do not know that. I am very interested in this, can you share more about?
@curtnorvalf534 Whenever log generated pass to WhatsApp using Twilio, go to Twilio document you will get some idea.
My observer:
<?php ini_set("memory_limit", "-1"); require_once '/home/website/public_html/website_whatsapp_notification/vendor/autoload.php'; use Twilio\Rest\Client; class Gta_MatchProductOrder_Model_Observer { public function checkproductinorder($Observer) { $sid = "hrgrugrgrbggbeibgurbgrgbreu"; $token = "dngfngrgngnrtngngregrngreug"; $twilio = new Client($sid, $token); $order = $Observer->getEvent()->getOrder(); $items = $order->getAllItems(); $skus = array('6250109', '6926238', '6250108'); //product SKUs $skuList = array(); foreach ($items as $item) { if(in_array($item->getSku(), $skus)) { $orderid = $Observer->getEvent()->getOrder()->getIncrementId(); $skuList[] = $item->getSku(); } } // Mage::log('The order Id ' . $orderid . ' contains amazon list SKU : '.implode(',',$skuList), null, 'matchorder.log'); $messagesss = $twilio->messages ->create("whatsapp:+01236459877", // to array( "from" => "whatsapp:+02158745225", "body" => 'The order Id ' . $orderid . ' contains amazon list SKU : '.implode(',',$skuList) ) ); ### start test observer ### // $order = $Observer->getEvent(); // Mage::log($order->getName(),null,'orderproduct.log'); ### end test observer ### } }
.....