laenailk | Posts: 5

User getting error "No Role found for signer email [email address]"

0 votes
Our client is receiving the above error message when trying to send a package. We are not creating and sending a CustomID, so not sure what the problem is. They only receive this error periodically. Here is the log file error: 02/28/2019 08:30:39.00: No Role found for signer email [email protected] 02/28/2019 08:30:39.00: at Silanis.ESL.SDK.DocumentConverter.FindRoleIdForSigner(String signerEmail, Package createdPackage) at Silanis.ESL.SDK.DocumentConverter.ToAPIDocument(Package apiPackage) at Silanis.ESL.SDK.Services.PackageService.UploadDocuments(PackageId packageId, IList`1 documents) at Silanis.ESL.SDK.EslClient.CreatePackage(DocumentPackage package) at Contraxx.External.CtxPackageInfo.BuildAndSendPackage(List`1 documents, String exDate, Int32 firstReminder, Int32 daysBetweenReminders, Int32 numReminders) Here is our code to create a signer: SignerBuilder newSigner = SignerBuilder.NewSignerWithEmail(signer.email) .WithFirstName(signer.firstName) .WithLastName(signer.lastname) .WithTitle(signer.title) //.WithCustomId(signer.ID) .SigningOrder(signer.signingOrder) .WithEmailMessage(signer.emailMessage); pkg.WithSigner(newSigner);

Duo_Liang | Posts: 3776

Reply to: User getting error "No Role found for signer email [email address]"

0 votes
Hi laenailk, Thanks for posting on our Developer Community! Can I have your package ID and which environment are you in? From the error message and stack trace, it seems signer is not successfully added to the package. So we make sure the pkg object added with signer is the same reference when you passing in the EslClient.CreatePackage(DocumentPackage package) function? Also, a completed code snippet of your workflow could help troubleshoot this issue. You can both share the code in this thread or send to [email protected]. Duo

laenailk | Posts: 5

Reply to: User getting error "No Role found for signer email [email address]"

0 votes
Hi, There is no package ID; the package does not get created because of the error message. The real mystery is why this only happens very occasionally; 99% of the packages are created with no problem. Here is the code from creating the signer to the line where the error occurs: try { foreach (CtxRecipientInfo signer in signers) { SignerBuilder newSigner = SignerBuilder.NewSignerWithEmail(signer.email) .WithFirstName(signer.firstName) .WithLastName(signer.lastname) .WithTitle(signer.title) //.WithCustomId(signer.ID) .SigningOrder(signer.signingOrder) .WithEmailMessage(signer.emailMessage); pkg.WithSigner(newSigner); } } catch (Exception ex) { errorMessage = ex.Message; PortalUtils.WriteToLogfile(errorMessage, ""); PortalUtils.WriteToLogfile(ex.StackTrace, ""); throw; } } /// /// Add signature section for the given signer (idenified by email address) /// /// /// public void AddSignatureToDocument(DocumentBuilder document, CtxRecipientInfo signer) { try { if (signer.recipientType == CtxRecipientInfo.RecipientType.AcceptOnly) { AddAcceptOnly(document, signer); } else { TextAnchor sigAnchor = new TextAnchor(); sigAnchor.Position = TextAnchorPosition.TOPLEFT; sigAnchor.YOffset = signer.yOffset; sigAnchor.XOffset = signer.xOffset; sigAnchor.Height = signer.height; sigAnchor.Width = signer.width; sigAnchor.AnchorText = signer.anchorText; TextAnchor dateAnchor = new TextAnchor(); dateAnchor.Position = TextAnchorPosition.TOPLEFT; dateAnchor.YOffset = signer.signingDateInfo.yOffset; dateAnchor.XOffset = signer.signingDateInfo.xOffset; dateAnchor.Height = signer.signingDateInfo.height; dateAnchor.Width = signer.signingDateInfo.width; dateAnchor.AnchorText = signer.signingDateInfo.anchorText; TextAnchor titleAnchor = new TextAnchor(); titleAnchor.Position = TextAnchorPosition.TOPLEFT; titleAnchor.YOffset = signer.signingTitle.yOffset; titleAnchor.XOffset = signer.signingTitle.xOffset; titleAnchor.Height = signer.signingTitle.height; titleAnchor.Width = signer.signingTitle.width; titleAnchor.AnchorText = signer.signingTitle.anchorText; document.WithSignature(SignatureBuilder.SignatureFor(signer.email) .WithPositionAnchor(sigAnchor) .WithField(FieldBuilder.SignerTitle() .WithPositionAnchor(titleAnchor)) .WithField(FieldBuilder.SignatureDate() .WithPositionAnchor(dateAnchor))); } } catch (Exception ex) { errorMessage = ex.Message; PortalUtils.WriteToLogfile(errorMessage, ""); PortalUtils.WriteToLogfile(ex.StackTrace, ""); throw; } } /// /// /// /// /// public void AddAcceptOnly(DocumentBuilder document, CtxRecipientInfo signer) { try { document.WithSignature(SignatureBuilder.AcceptanceFor(signer.email)); } catch (Exception ex) { errorMessage = ex.Message; PortalUtils.WriteToLogfile(errorMessage, ""); PortalUtils.WriteToLogfile(ex.StackTrace, ""); throw; } } /// /// Complete the back building process and send the package. /// /// /// /// /// /// /// public String BuildAndSendPackage(List documents, string exDate = "", int firstReminder = 0, int daysBetweenReminders = 0, int numReminders = 0) { PackageId package = null; try { //Haven't add the documents to the package yet. foreach (DocumentBuilder docBuilder in documents) { pkg.WithDocument(docBuilder); } //Initialize the eSignClient EslClient client = new EslClient(apiKey, url); DocumentPackage docPackage = pkg.Build(); package = client.CreatePackage(docPackage);

Duo_Liang | Posts: 3776

Reply to: User getting error "No Role found for signer email [email address]"

0 votes
Hi laenailk, Because you are using EslClient.CreatePackage(DocumentPackage package) function. Internally, SDK will separate the process into three calls: 1. first create a package with signers and all other settings 2. retrieve the created package 3. then, upload document files and their metadata. In this process SDK will compare the retrieved package to the object you created locally, the exception appears right in this step when SDK was converting SDK object to REST object, it was trying to matching the signer you set in your document object locally to the created package. So my suggestion here could be, you can use EslClient.CreatePackageOneStep(DocumentPackage package) instead CreatePackage where a fully-baked package will be sent within one call vs three calls. And as I mentioned above, even though you didn't receive PackageId object due to the exception, a package actually should have been created where you can check on your webportal(sandbox/apps.esignlive.com/login). Duo

laenailk | Posts: 5

Reply to: User getting error "No Role found for signer email [email address]"

0 votes
Duo, thank you very much for the explanation. We will definitely switch over to the "one-step" approach. Do we need to change anything else to accommodate this, or just call it in place of the other one?

Duo_Liang | Posts: 3776

Reply to: User getting error "No Role found for signer email [email address]"

0 votes
Hi laenailk, No, given the code snippet, you don't need to change anywhere else. There would be only few scenarios you need to change your code, and one of them is, when you added signatures for your sender/owner while you didn’t explicitly assign him/her as a signer with the function .WithSigner(). CreatePackage function first created a package internally and sender will automatically be added to your package so you don't need to manually add them, while CreatePackageOneStep function requires you to include all signers before creation. In your case, since all signatures have been binded to CtxRecipientInfo objects whom have already been added to package, this difference won't affect you. Duo

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