diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml
index b9f571e4..152e160a 100644
--- a/.github/workflows/build_and_test.yml
+++ b/.github/workflows/build_and_test.yml
@@ -30,10 +30,8 @@ jobs:
matrix:
include:
# Ubuntu
- - { name: 'Linux .NET Core 3', os: ubuntu-22.04, framework: 'netcoreapp3.1' }
- { name: 'Linux .NET 5', os: ubuntu-22.04, framework: 'net5' }
# macOs
- - { name: 'macOS .NET Core 3', os: macOS-latest, framework: 'netcoreapp3.1' }
- { name: 'macOS .NET 5', os: macOS-latest, framework: 'net5' }
# Windows
- { name: 'Windows .NET Core 3', os: windows-latest, framework: 'netcoreapp3.1' }
@@ -68,7 +66,6 @@ jobs:
}
- name: Setup .NET SDK
- if: (runner.os == 'macOS' || runner.os == 'Linux')
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 25150065..0a86f696 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org).
## [Unreleased] - TBD
+## [1.1.1] - 2023-05-02
+### Added
+- Properties for sign invite that allows you to prefill text in the Signature field, allows for signers to use their saved signature, allows recipients reassign this invite to another email address, allow recipients decline the invite.
+- Add support for field type `stamp` [#149](https://github.com/signnow/SignNow.NET/issues/149)
## [1.1.0] - 2023-01-23
### Added
diff --git a/SignNow.Net.Test/UnitTests/Models/SignInviteTest.RoleBased.cs b/SignNow.Net.Test/UnitTests/Models/SignInviteTest.RoleBased.cs
index ca1a41ea..2b5ff9bf 100644
--- a/SignNow.Net.Test/UnitTests/Models/SignInviteTest.RoleBased.cs
+++ b/SignNow.Net.Test/UnitTests/Models/SignInviteTest.RoleBased.cs
@@ -45,13 +45,25 @@ public void ShouldCreateRoleBasedInviteContent()
var document = new SignNowDocumentFaker()
.RuleFor(o => o.Roles, new RoleFaker().Generate(2));
- var roleBasedInvite = new RoleBasedInvite(document);
+ var roleBasedInvite = new RoleBasedInvite(document)
+ {
+ Message = "test-message",
+ Subject = "test-subject"
+ };
// Set user to documents' role
var roles = roleBasedInvite.DocumentRoles();
Assert.AreEqual(2, roles.Count);
- var signer1Options = new SignerOptions("signer1@signnow.com", roles.First());
+ var signer1Options = new SignerOptions("signer1@signnow.com", roles.First())
+ {
+ AllowToReassign = false,
+ DeclineBySignature = true,
+ SignatureNamePrefill = "User-signature-name",
+ SignatureNameRequiredPreset = "required-signature-preset",
+ ForceNewSignature = false
+ };
+
var signer2Options = new SignerOptions("signer2@signnow.com", roles.Last())
{
ExpirationDays = 15
@@ -71,7 +83,12 @@ public void ShouldCreateRoleBasedInviteContent()
'email':'signer1@signnow.com',
'role':'Signer 1',
'role_id':'{roles.First().Id}',
- 'order':1
+ 'order':1,
+ 'prefill_signature_name': 'User-signature-name',
+ 'required_preset_signature_name': 'required-signature-preset',
+ 'force_new_signature': 0,
+ 'reassign': 0,
+ 'decline_by_signature': 1
}},
{{
'email':'signer2@signnow.com',
@@ -83,8 +100,8 @@ public void ShouldCreateRoleBasedInviteContent()
'expiration_days':15
}}
],
- 'subject':null,
- 'message':null,
+ 'subject': 'test-subject',
+ 'message': 'test-message',
'cc':[],
'from':'sender@signnow.com'
}}";
diff --git a/SignNow.Net/Model/Field.cs b/SignNow.Net/Model/Field.cs
index 682f6d22..235ea528 100644
--- a/SignNow.Net/Model/Field.cs
+++ b/SignNow.Net/Model/Field.cs
@@ -86,6 +86,12 @@ public enum FieldType
[EnumMember(Value = "signature")]
Signature,
+ ///
+ /// Stamp fields.
+ ///
+ [EnumMember(Value = "stamp")]
+ Stamp,
+
///
/// Initials fields.
///
diff --git a/SignNow.Net/Model/SignerOptions.cs b/SignNow.Net/Model/SignerOptions.cs
index 513d610b..f7329336 100644
--- a/SignNow.Net/Model/SignerOptions.cs
+++ b/SignNow.Net/Model/SignerOptions.cs
@@ -2,6 +2,7 @@
using Newtonsoft.Json;
using SignNow.Net.Internal.Extensions;
using SignNow.Net.Internal.Helpers;
+using SignNow.Net.Internal.Helpers.Converters;
using SignNow.Net.Internal.Model;
namespace SignNow.Net.Model
@@ -47,6 +48,42 @@ public sealed class SignerOptions
[JsonProperty("order")]
public int SigningOrder => SignerRole.SigningOrder;
+ ///
+ /// Prefilled text in the Signature field, available for editing by signer.
+ ///
+ [JsonProperty("prefill_signature_name", NullValueHandling = NullValueHandling.Ignore)]
+ public string SignatureNamePrefill { get; set; }
+
+ ///
+ /// PPrefilled text in the Signature field, disabled for editing by signer.
+ ///
+ [JsonProperty("required_preset_signature_name", NullValueHandling = NullValueHandling.Ignore)]
+ public string SignatureNameRequiredPreset { get; set; }
+
+ ///
+ /// Whether or not the signer can use their saved signature.
+ /// Possible values:
+ /// `false` - signer can use a saved signature,
+ /// `true` - signer has to add a new signature.
+ ///
+ [JsonProperty("force_new_signature", NullValueHandling = NullValueHandling.Ignore)]
+ [JsonConverter(typeof(BoolToIntJsonConverter))]
+ public bool? ForceNewSignature { get; set; }
+
+ ///
+ /// Whether or not to allow recipients reassign this invite to another email address.
+ ///
+ [JsonProperty("reassign", NullValueHandling = NullValueHandling.Ignore)]
+ [JsonConverter(typeof(BoolToIntJsonConverter))]
+ public bool? AllowToReassign { get; set; }
+
+ ///
+ /// Whether or not to allow recipients decline the invite.
+ ///
+ [JsonProperty("decline_by_signature", NullValueHandling = NullValueHandling.Ignore)]
+ [JsonConverter(typeof(BoolToIntJsonConverter))]
+ public bool? DeclineBySignature { get; set; }
+
///
/// Authentication type for case, when password used to open the Document.
///
diff --git a/SignNow.Net/_Internal/Helpers/Converters/BoolToIntJsonConverter.cs b/SignNow.Net/_Internal/Helpers/Converters/BoolToIntJsonConverter.cs
new file mode 100644
index 00000000..7841ee67
--- /dev/null
+++ b/SignNow.Net/_Internal/Helpers/Converters/BoolToIntJsonConverter.cs
@@ -0,0 +1,26 @@
+using System;
+using Newtonsoft.Json;
+
+namespace SignNow.Net.Internal.Helpers.Converters
+{
+ ///
+ /// Converts to
+ ///
+ internal class BoolToIntJsonConverter : JsonConverter
+ {
+ public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
+ {
+ writer.WriteValue(((bool)value) ? 1 : 0);
+ }
+
+ public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
+ {
+ return reader.Value.ToString() == "1";
+ }
+
+ public override bool CanConvert(Type objectType)
+ {
+ return objectType == typeof(bool);
+ }
+ }
+}
diff --git a/SignNow.props b/SignNow.props
index c468c97e..35044302 100644
--- a/SignNow.props
+++ b/SignNow.props
@@ -2,7 +2,7 @@
- 1.1.0
+ 1.1.1
signNow
signNow
signNow.Net is a .NET 4.5+ and .NET standard class library for the signNow API. (Official Library)
diff --git a/codecov.yml b/codecov.yml
index ec1d6bc9..f4d7aab2 100644
--- a/codecov.yml
+++ b/codecov.yml
@@ -1,7 +1,7 @@
codecov:
notify:
require_ci_to_pass: yes # require the build to pass before submitting notifications
- after_n_builds: 7 # how many build to wait for before submitting notifications, therefore skipping status checks
+ after_n_builds: 5 # how many build to wait for before submitting notifications, therefore skipping status checks
coverage:
precision: 2