You need to sign in to do that
Don't have an account?
rupesh ranjan
Hello everyone
Ho to use Sytem.debug in this code..
global with sharing class sendsms {
@future(callout=true)
webservice static void sendsms1(String strPhone,String strName){
AppRemind__c c =[Select Name,Email_Address__c,Phone_Mobile_Number__c, Alert__c from AppRemind__c];
if(c.Name != null){
if(c.Phone_Mobile_Number__c != null){
//String txt='Your Appointment No. '+c.Name+'';
String email=''+c.Email_Address__c+'';
String phn=''+c.Phone_Mobile_Number__c+'';
HttpRequest req = new HttpRequest();
//Setting Endpoint URL to HTTP request
req.setEndpoint('http://104.236.190.198/API/api.php?request=test_alert&api_key=827ccb0eea8a706c4c34a16891f84e7b&agent_id=11&temp_id=10&type=2&language=en&email_id='+email+'&phone='+phn);
//set the request type
req.setMethod('GET');
//HTTP object creation
Http http = new Http();
//Sending the Req throgh HTTPResponse object.
HTTPResponse res = http.send(req);
System.debug('---------->'+res);
}
}
}
}
global with sharing class sendsms {
@future(callout=true)
webservice static void sendsms1(String strPhone,String strName){
AppRemind__c c =[Select Name,Email_Address__c,Phone_Mobile_Number__c, Alert__c from AppRemind__c];
if(c.Name != null){
if(c.Phone_Mobile_Number__c != null){
//String txt='Your Appointment No. '+c.Name+'';
String email=''+c.Email_Address__c+'';
String phn=''+c.Phone_Mobile_Number__c+'';
HttpRequest req = new HttpRequest();
//Setting Endpoint URL to HTTP request
req.setEndpoint('http://104.236.190.198/API/api.php?request=test_alert&api_key=827ccb0eea8a706c4c34a16891f84e7b&agent_id=11&temp_id=10&type=2&language=en&email_id='+email+'&phone='+phn);
//set the request type
req.setMethod('GET');
//HTTP object creation
Http http = new Http();
//Sending the Req throgh HTTPResponse object.
HTTPResponse res = http.send(req);
System.debug('---------->'+res);
}
}
}
}
This is not elegant but in most cases works for me. Try to paste at the end of the method i.e.
Exception will be thrown but you will be able to review debug log.
Hope this helps,
Lukasz