Skip to content

Commit

Permalink
Merge pull request #4 from sandeshbodake/sandesh/support-for-reminder…
Browse files Browse the repository at this point in the history
…-email

feat: send reminder api integration
  • Loading branch information
williamkennedy authored Jul 4, 2024
2 parents e743c18 + d212500 commit 471bacb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/sign_well/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(x_api_key:, stubs: nil)
def document(id, params = {})
DocumentResource.new(self).get(id, params)
end

def create_document(params)
DocumentResource.new(self).create(params)
end
Expand All @@ -32,6 +32,10 @@ def completed_pdf(id, params)
DocumentResource.new(self).completed_pdf(id, params)
end

def remind_document(id, params = {})
DocumentResource.new(self).remind(id, params)
end

def template(id, params = {})
TemplateResource.new(self).get(id, params)
end
Expand Down
4 changes: 4 additions & 0 deletions lib/sign_well/resources/document_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@ def delete(id)
def completed_pdf(id, params)
Response.new(get_request("documents/#{id}/completed_pdf", params).body)
end

def remind(id, params)
Response.new(post_request("documents/#{id}/remind", params).body)
end
end
end
8 changes: 8 additions & 0 deletions test/sign_well/resources/document_resource_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ def test_delete_document
assert_equal 204, response.to_object.status
end

def test_remind_document
id = "123"
stubs = stub_post_request("documents/#{id}/remind", response: File.read("test/fixtures/document.json"))
client = SignWell::Client.new(x_api_key: "key", stubs: stubs)
response = client.remind_document(id)
assert_response_body(response)
end

def test_completed_pdf
id = "123"
stubs = stub_get_request("documents/#{id}/completed_pdf", response: File.read("test/fixtures/completed_pdf.json"))
Expand Down

0 comments on commit 471bacb

Please sign in to comment.