1

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.

asked Jan 12, 2016 at 11:05

1 Answer 1

1

Use strtr It will translate parts of a string.

 $orderid = "51";
 $vars = array(
 '{$orderid}' => $orderid,
 '{{order_id}}' => $orderid,
); 
echo strtr($data, $vars);
answered Jan 12, 2016 at 11:16
2
  • 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? Commented Jan 12, 2016 at 12:11
  • defined method for emails you are not using the email template so that is solution for you.. Commented Jan 12, 2016 at 12:12

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.