public static Message create ( final String to , final String from , final String text , final ReceiptRequest receiptRequest ) throws Exception { final Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( "to" , to ) ; params . put ( "from" , from ) ; params . put ( "text" , text ) ; if ( receiptRequest != null ) { params . put ( "receiptRequested" , receiptRequest . toString ( ) ) ; } else { params . put ( "receiptRequested" , ReceiptRequest . NONE . toString ( ) ) ; } return create ( params ) ; }
Convenience factory method to send a message with receipt given the to number the from number and the text