Add support for eventNotification
parent
637ad6a111
commit
bae4ad44d1
|
@ -12,6 +12,7 @@ require "docurest/envelope"
|
|||
require "docurest/envelope/document"
|
||||
require "docurest/envelope/email"
|
||||
require "docurest/envelope/email_settings"
|
||||
require "docurest/envelope/event_notification"
|
||||
require "docurest/envelope/recipient"
|
||||
require "docurest/envelope/recipient/tab"
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ module Docurest
|
|||
field :custom_fields, :customFields
|
||||
|
||||
field :email_settings, :emailSettings, ->(value) { Docurest::Envelope::EmailSettings.new value }
|
||||
field :event_notification, :eventNotification, ->(value) { Docurest::Envelope::EventNotification.new value }
|
||||
|
||||
association(:recipients, :envelope_id) { Docurest::Envelope::Recipient.list(guid) }
|
||||
def save_recipients(resend: false)
|
||||
|
@ -94,6 +95,7 @@ module Docurest
|
|||
emailSubject: emailSubject,
|
||||
emailBlurb: emailBlurb,
|
||||
emailSettings: emailSettings.to_h,
|
||||
eventNotification: eventNotification.to_h,
|
||||
}.tap do |hash|
|
||||
if documents_changed?
|
||||
hash[:documents] = documents.map(&:to_h)
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
module Docurest
|
||||
class Envelope::EventNotification < Docurest::Base
|
||||
field :envelope_id
|
||||
field :envelope_events, :envelopeEvents
|
||||
field :recipient_events, :recipientEvents
|
||||
field :url
|
||||
field :logging, :loggingEnabled, :boolean
|
||||
|
||||
def to_h
|
||||
{
|
||||
envelopeEvents: envelopeEvents,
|
||||
recipientEvents: recipientEvents,
|
||||
url: url,
|
||||
loggingEnabled: loggingEnabled,
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue