php
  • html
  • sms
  • 2017-05-21 6 views 1 likes 
    1

    나는 각 SMS에 링크가있는 텍스트가 들어있는 SMS 캠페인을 실행하는 시나리오가 있습니다. 이 링크는 동적이며 사용자별로 SMS마다 다릅니다. 내 SMS 콘텐츠 - "친애하는 사용자, 활동을 수행하려면 click here하시기 바랍니다."SMS의 텍스트로 사용되는 phtml 변수의 동적 HTML 링크 (href) 코드

    아래 코드는 제가 사용하고있는 코드입니다. enter image description here

    내가 여기에 실수를하고있는 중이 야 -

    $smsusername = 'xxxxxx'; 
    $smspassword = 'xxxxxx'; 
    $destination = $phone; 
    $url = "http://www.example.com/?id=1" 
    $source = 'SENDER-NM'; 
    $text1 = 'Dear User, Please '; 
    $parturl = '<a href="$url">click here </a>'; 
    $text2 = 'to perform the activity.'; 
    
    $text = $text1 . $parturl . $text2; 
    
    $content = 'action=sendsms'. 
          '&user='.rawurlencode($smsusername). 
          '&password='.rawurlencode($smspassword). 
          '&to='.rawurlencode($destination). 
          '&from='.rawurlencode($source). 
          '&text='.rawurlencode($text); 
    
    $smsglobal_response = file_get_contents('http://www.smsglobal.com.au/http-api.php?'.$content); 
    
    $explode_response = explode('SMSGlobalMsgID:', $smsglobal_response); 
    

    나는 어떤이의 오류 여전히 내가 점점 오전 SMS 이런 식으로 뭔가가이 없는지 생각합니다. 조언하십시오

    +0

    귀하의 SMS가 일반 텍스트로 보내 졌거나 SMS API에 대한 자세한 정보를 제공하거나 API 지원 팀에 문의하는 것으로 보입니다. – hassan

    +0

    @hassan : smsglobal의 api를 사용하여 SMS를 보냅니다. 여기에 그 문서가 있습니다 - http://smsglobal.com/http-api/?_ga=2.244836549.1944820390.1495353526-723294973.1495033748 – user1299086

    +0

    HTML 콘텐츠를 거기서 보내는 것에 대한 단서를 찾기가 어렵습니다. HTML을 지원한다고 생각하지 않습니다. , 이메일 - API https://www.smsglobal.com/services/에서도 "메시지 본문이 HTML이 아닌 일반 텍스트인지 확인하십시오"라는 메시지가 표시됩니다. – hassan

    답변

    0

    그래서 나는 SMS가 SMS 게이트웨이 제공자로부터의 일반 텍스트로만 전송되고 있다고 생각했습니다. 내가 사용하는이 솔루션은 bitly 짧은 링크 API를 사용 -

    $short_url = json_decode(file_get_contents("http://api.bit.ly/v3/shorten?login=mylogin&apiKey=myapikey&longUrl=".urlencode("$url")."&format=json"))->data->url; 
    

    을이 같은 SMS의 콘텐츠를 만드는 -

    내 마지막 텍스트는 다음과 같습니다
    $text = $text1 . $short_url . $text2; 
    

    -

    친애하는 사용자, http://shortlurllink을 방문하여 활동을 수행하십시오.

    나는 이전에 원했던 동일한 작업을 수행하므로 내가 원하는 것을 얻습니다. :)

    감사합니다. @hassan.

     관련 문제

    • 관련 문제 없음^_^