I have created a custom module for send SMS at the time of order place, I have created a observer for this which works and send SMS to customer. I have provide message field in system configration and want to send this message to customer but I don't know how to create and use custom variable {order_id} in sms configration setting.
System configration setting figure as below : enter image description here
As shown in above figure I want to use custom variable in message input field and want to send order_id from observer when message send.
1 Answer 1
Use strtr It will translate parts of a string.
$orderid = "51";
$vars = array(
'{$orderid}' => $orderid,
'{{order_id}}' => $orderid,
);
echo strtr($data, $vars);
-
Thanks for reply, Are you sure this is the correct way to replace {order_id} by $order_id, Is there not any another method for define and use variables?Vinaya Maheshwari– Vinaya Maheshwari2016年01月12日 12:11:13 +00:00Commented Jan 12, 2016 at 12:11
-
defined method for emails you are not using the email template so that is solution for you..Qaisar Satti– Qaisar Satti2016年01月12日 12:12:42 +00:00Commented Jan 12, 2016 at 12:12