ranjan_prajapati | Posts: 5

Add Sender to the package

0 votes
Hi, We are integrating esign with Salesforce. When we create a package, the owner of the eSign Live becomes the sender of the package. Is there a way to send the package as another user in esign account? Regards Ranjan

Duo_Liang | Posts: 3776

Reply to: Add Sender to the package

0 votes
Hey Ranjan, Yes, "send the package as another user" feature is available in OneSpan Sign as well as in Apex SDK. For the REST method, refer to "CREATE A PACKAGE ON BEHALF OF ANOTHER USER" section in this documentation. For Apex SDK code, here's some code snippet:
public with sharing class TestSendOnBehalfOfSender {
    
     public String testSendOnBehalfOfSender() {
        //Create esl client
        OneSpanSDK sdk = new OneSpanSDK();
         
        //Create package
        OneSpanAPIObjects.Package_x pkg = new OneSpanAPIObjects.Package_x();
        pkg.name = 'Test Send On Behalf Of Sender - ' + Datetime.now().format();
         
        OneSpanAPIObjects.Sender sender = new OneSpanAPIObjects.Sender();
        sender.email = 'sender_email_under_your_account';
        pkg.sender = sender;
         
        String packageId = sdk.createPackage(pkg);
        System.debug('PackageId: ' + packageId);
        
        return packageId;   
    }

}
We did some rebrand in class naming convention (from ESignLiveSDK to OneSpanSDK, so on so forth), but you can easily replace the name by keywords "ESignLive" and "OneSpan". Hope this could help! 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