byudichak | Posts: 12

Custom Send Button - Detect if signature has been added

0 votes
We have embedded the prepare iframe within our application and ran into a little hiccup. We use a custom Send button to match our application, but we need to determine if a signature field has been added before allowing users to proceed. Is there a way for us to determine that? If not is there a way for support to change the appearance of the "Send" button that appears in the iframe?

Approved Answer
harishaidary | Posts: 1812

Reply to: Custom Send Button - Detect if signature has been added

0 votes
Hey, Unfortunately, the appearance of the send button in the designer view is not customizable. Because you are embedding a URL in an iframe which is not your domain (i.e. esignlive), you cannot capture events inside the iframe (cross-domain issue). What I can suggest you to do is once your user clicks on your custom send button, you can use your package id to retrieve your package and verify the number of signatures on the document (in the back-end). If everything is fine, you can send the package using back-end code and close the iframe. If there are signatures missing, then you could pass an error message to the front-end to let your user know that signatures are missing. Hope this helps.

byudichak | Posts: 12

Reply to: Custom Send Button - Detect if signature has been added

0 votes
Thanks Haris. We thought this was probably the route we should take, but wanted to exhaust any other options first. Thanks again, Bill

harishaidary | Posts: 1812

Reply to: Custom Send Button - Detect if signature has been added

0 votes
My pleasure :)

csabo | Posts: 40

Reply to: Custom Send Button - Detect if signature has been added

0 votes
Haris, Can you tell me the easiest way to retrieve if the document has signatures in the SDK? I think right now I'm looping through all the documents and then calling ApprovalService.GetAllSignableSignatures. However, this service call is on a document by user basis and is not very efficient. Is there a different call to make to see if signatures have been added? Thanks Colleen

harishaidary | Posts: 1812

Reply to: Custom Send Button - Detect if signature has been added

0 votes
Hey Collen, The other way I can suggest you to retrieve the signatures is by simply making one call to retrieve your DocumentPackage object. Then, you can loop through each document and check for the signatures. It not necessary to call on the ApprovalService. Here's a sample code:
 EslClient client = new EslClient(key, url);

            PackageId packageId = new PackageId("f_GegBl2kXc9Bc_H9BYACHsRVNA=");

            DocumentPackage package = client.GetPackage(packageId);

            IList docs = package.Documents;

            foreach (Document doc in docs)
            {
                IList sigs = doc.Signatures;

                if (sigs.Count() != 0)
                {
                    foreach (Signature sig in sigs)
                    {
                        Debug.WriteLine(sig.SignerEmail);
                    }
                }
                
            }

csabo | Posts: 40

Reply to: Custom Send Button - Detect if signature has been added

0 votes
Hi Haris! This is great. If I wanted to extend this to determine which signers where added to the signature list, can I look that up by the custom signerId? Thanks Colleen

harishaidary | Posts: 1812

Reply to: Custom Send Button - Detect if signature has been added

0 votes
Hey Collen, I'm not really sure what you are asking. The sample code I posted prints out the signer's email. So you can definitely figure out who the signer is based on that. If you're looking to retrieve signers and the custom id from the package, you could do something similar:
DocumentPackage package = client.GetPackage(packageId);

IList signers = package.Signers;

foreach (Signer signer in signers) {
                Debug.WriteLine(signer.Id);
}

csabo | Posts: 40

Reply to: Custom Send Button - Detect if signature has been added

0 votes
Haris, In addition to knowing that a signature has been added, I need to know who was added, so that I can send an email to that person. Here's my scenario. I have 3 signers in the designer view add signature drop down box. I only add 2 signer's signatures to the document. How do I know which 2 of the 3 signers have been added to the document? Is there a way to check the signature list by signer id instead of email address? Thanks Colleen

harishaidary | Posts: 1812

Reply to: Custom Send Button - Detect if signature has been added

0 votes
I tried a couple of things. Unfortunately, it doesn't seem you can get the custom signer id from the signature list.

csabo | Posts: 40

Reply to: Custom Send Button - Detect if signature has been added

0 votes
Haris, Thank you for looking. I'll see if I can get this information from a REST call to get the package. Thanks Colleen

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off