Follow up 697661cbf2 - Missing gem loadings for Twilio SMS channel driver causes application to break.

This commit is contained in:
Rolf Schmidt 2021-07-12 08:09:02 +00:00 committed by Thorsten Eckel
parent ce5fa9def9
commit 2770f0a370

View file

@ -36,6 +36,7 @@ class Channel::Driver::Sms::Twilio
# prevent already created articles
if Ticket::Article.exists?(message_id: attr[:SmsMessageSid])
require 'twilio-ruby' # Only load this gem when it is really used
return ['application/xml; charset=UTF-8;', Twilio::TwiML::MessagingResponse.new.to_s]
end
@ -117,6 +118,7 @@ class Channel::Driver::Sms::Twilio
}
)
require 'twilio-ruby' # Only load this gem when it is really used
['application/xml; charset=UTF-8;', Twilio::TwiML::MessagingResponse.new.to_s]
end