3131@ Controller
3232@ RequestMapping ("/eg020" )
3333public class EG020ControllerSmsAuthentication extends AbstractController {
34-
35- private static final List <String > RECIPIENT_PHONE_NUMBERS = List .of ("415-555-1212" , "415-555-3434" );
34+ // For List.of you could even do groups of numbers such as List.of("415-555-1212", "415-555-3434");
3635 private static final String DOCUMENT_FILE_NAME = "World_Wide_Corp_lorem.pdf" ;
3736 private static final String DOCUMENT_NAME = "Lorem" ;
3837
@@ -57,7 +56,7 @@ protected Object doWork(WorkArguments args, ModelMap model,
5756 EnvelopesApi envelopesApi = createEnvelopesApi (session .getBasePath (), user .getAccessToken ());
5857
5958 // Step 3: Construct your envelope JSON body
60- EnvelopeDefinition envelope = createEnvelope (args .getSignerName (), args .getSignerEmail ());
59+ EnvelopeDefinition envelope = createEnvelope (args .getSignerName (), args .getSignerEmail (), args . getPhoneNumber () );
6160
6261 // Step 4: Call the eSignature REST API
6362 EnvelopeSummary results = envelopesApi .createEnvelope (accountId , envelope );
@@ -72,7 +71,7 @@ protected Object doWork(WorkArguments args, ModelMap model,
7271 return DONE_EXAMPLE_PAGE ;
7372 }
7473
75- private static EnvelopeDefinition createEnvelope (String signerName , String signerEmail ) throws IOException {
74+ private static EnvelopeDefinition createEnvelope (String signerName , String signerEmail , String phoneNumber ) throws IOException {
7675 Document doc = EnvelopeHelpers .createDocumentFromFile (DOCUMENT_FILE_NAME , DOCUMENT_NAME , "1" );
7776
7877 SignHere signHere = new SignHere ();
@@ -85,7 +84,7 @@ private static EnvelopeDefinition createEnvelope(String signerName, String signe
8584 // A 1- to 8-digit integer or 32-character GUID to match recipient IDs on your own systems.
8685 // This value is referenced in the Tabs element below to assign tabs on a per-recipient basis.
8786 signHere .setRecipientId ("1" );
88-
87+ List < String > RECIPIENT_PHONE_NUMBERS = List . of ( phoneNumber );
8988 RecipientSMSAuthentication smsAuth = new RecipientSMSAuthentication ();
9089 smsAuth .setSenderProvidedNumbers (RECIPIENT_PHONE_NUMBERS );
9190
0 commit comments