在JSon中添加变量不起作用

i am trying to add variable in json variable then try to send email i am getting variable not Variable Value please take a look :

$request_json = '{
           "type":"messages",
           "call":"send",
           "message":{
              "html":"$salesmsgUpdatemsg",
              }'; 

$request_json = '{
           "type":"messages",
           "call":"send",
           "message":{
              "html":"'.$salesmsgUpdatemsg.'",
              }';

Both codes not working if i use

$request_json = '{
           "type":"messages",
           "call":"send",
           "message":{
              "html":"Content Text",
              }'; 

Its working fine.

No idea what happen.

Thanks

You should follow jeoren advice because one day your code will break.

$request = array ('type'=>"messages",
                  'call'=>'send',
                  'message'=>array(
                        'html'=>$salesmsgUpdatemsg
                ));

$request_json = json_encode($request);