Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ability to Resend Invites #153

Open
SimonEvans482 opened this issue May 24, 2023 · 1 comment
Open

Add Ability to Resend Invites #153

SimonEvans482 opened this issue May 24, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@SimonEvans482
Copy link

I have added this to my local copy, but thought may be useful for others to include in release.

Need to add a property for Field_Request_Id to the ISignNowField interface (and the Field class):

        /// <summary>
        /// Field Request ID - Needed for Resend Invite
        /// </summary>
        [JsonProperty("field_request_id")]
        public string Field_Request_Id { get; }

This ID can then be retrieved from a Document and used for the Resend API call

ISignInvite Interface:

        /// <summary>
        /// ReSends a Role Based Invite to the Specified Invite ID.
        /// </summary>
        /// <param name="inviteFieldId">The Role identity to resend the invitation to.</param>
        /// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
        /// <returns></returns>
        Task ReSendRoleBasedInviteAsync(string inviteFieldId, CancellationToken cancellationToken = default);

UserServices.cs:

        /// <inheritdoc cref="ISignInvite.ReSendRoleBasedInviteAsync(string, CancellationToken)" />
        /// <exception cref="ArgumentException">Invalid format of <paramref name="inviteFieldId"/>.</exception>
        public async Task ReSendRoleBasedInviteAsync(string inviteFieldId, CancellationToken cancellationToken = default)
        {
            await ProcessReSendRoleBasedInviteAsync($"/fieldinvite/{inviteFieldId.ValidateId()}/resend", cancellationToken).ConfigureAwait(false);
        }
        private async Task ProcessReSendRoleBasedInviteAsync(string inviteFieldId,CancellationToken cancellationToken)
        {
            var requestOptions = new PutHttpRequestOptions
            {
                RequestUrl = new Uri(ApiBaseUrl, inviteFieldId),
                Token = Token
            };

            await SignNowClient.RequestAsync(requestOptions, cancellationToken).ConfigureAwait(false);
        }
@AlexNDRmac AlexNDRmac added the enhancement New feature or request label May 24, 2023
@AlexNDRmac
Copy link
Contributor

Thank you for suggestion. I'll add this with next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants