class Talkable::API::Share

Constants

SEND_EMAIL

direct

VIA_FACEBOOK

social

VIA_FB_MESSAGE
VIA_LINKEDIN
VIA_OTHER
VIA_SMS
VIA_TWITTER
VIA_WHATSAPP

Public Class Methods

create(short_url_code, channel) click to toggle source
# File lib/talkable/api/share.rb, line 18
def create(short_url_code, channel)
  warn "[DEPRECATION] `create` is deprecated.  Please use `social` or `direct` instead."
  social(short_url_code, channel: channel)
end
direct(short_url_code, channel: SEND_EMAIL, recipients:, subject: nil, body: nil, reminder: nil) click to toggle source
# File lib/talkable/api/share.rb, line 29
def direct(short_url_code, channel: SEND_EMAIL, recipients:, subject: nil, body: nil, reminder: nil)
  raise ArgumentError, 'Email is the only supported sharing channel' unless channel == SEND_EMAIL
  post "/offers/#{short_url_code}/shares/#{channel}", {
    recipients: recipients,
    subject: subject,
    body: body,
    reminder: reminder,
  }
end
social(short_url_code, channel:) click to toggle source
# File lib/talkable/api/share.rb, line 23
def social(short_url_code, channel:)
  post "/offers/#{short_url_code}/shares/social", {
    channel: channel,
  }
end