Sha256: f816d9df96296e65fe8f33de40620a9cdfb6f075014d7e01913ec6d5df5e5005

Contents?: true

Size: 366 Bytes

Versions: 18

Compression:

Stored size: 366 Bytes

Contents

module Cmor::Contact
  class WhatsappRequest
    include ActiveModel::Model

    attr_accessor :message

    validates :message, presence: true

    def whatsapp_link
      "https://wa.me/#{number_for_url}?text=#{URI.encode(message)}"
    end

    def number_for_url
      Cmor::Contact::Configuration.whatsapp_number&.gsub("+", "")&.gsub(" ", "")
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
cmor_contact-0.0.60.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.59.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.58.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.57.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.56.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.55.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.54.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.53.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.52.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.51.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.50.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.49.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.48.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.45.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.44.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.43.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.42.pre app/models/cmor/contact/whatsapp_request.rb
cmor_contact-0.0.41.pre app/models/cmor/contact/whatsapp_request.rb