Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/itexmo/itexmo_channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class ItexmoChannel < Channel
include GenericChannel

configuration_accessor :email, :api_code, :incoming_password, :api_password, :sender_id
configuration_accessor :email, :api_code, :incoming_password, :api_password, :sender_id, :sms_send_url
validates_presence_of :email, :api_code, :incoming_password, :api_password, :sender_id
before_validation :generate_incoming_password
handle_password_change :api_code
Expand Down
4 changes: 3 additions & 1 deletion app/models/itexmo/send_itexmo_message_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ def managed_perform
delivery_report_url: NamedRoutes.itexmo_delivery_url(@account.name, @channel.name, @config[:incoming_password], @msg.id)
})

target_url = @config[:sms_send_url].present? ? @config[:sms_send_url] : Itexmo::SMS_SEND_URL

begin
raw_response = RestClient::Request.execute(:method => :post, :url => Itexmo::SMS_SEND_URL, :payload => query_parameters, :timeout => 30)
raw_response = RestClient::Request.execute(:method => :post, :url => target_url, :payload => query_parameters, :timeout => 30)

response = JSON.parse raw_response

Expand Down
4 changes: 4 additions & 0 deletions app/views/channels/_form_itexmo.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<%= f.text_field :incoming_password, :autocomplete => :off, :maxlength => 32 -%>
<input type="button" onClick="regenerate_token()" value="Regenerate Password" />
</p>
<p>
<%= f.label :sms_send_url, "SMS Send URL" %><br />
<%= f.text_field :sms_send_url, title: "Leave blank to use the default Itexmo API endpoint" %>
</p>
<%= render 'edit_footer', :f => f %>
<%- end -%>

Expand Down
Loading