use rest-client instead of linux command 'curl' to send request
Signed-off-by: Luan Shengde shdluan@163.com --- container/mail-robot/lib/apply-account.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/container/mail-robot/lib/apply-account.rb b/container/mail-robot/lib/apply-account.rb index aea1aa5..e8288d7 100755 --- a/container/mail-robot/lib/apply-account.rb +++ b/container/mail-robot/lib/apply-account.rb @@ -5,6 +5,7 @@
require 'json' require 'mail' +require 'rest-client' require_relative '../../../lib/es_client' require_relative 'assign-account-email' require_relative 'assign-account-fail-eamil' @@ -131,6 +132,7 @@ class ApplyAccount build_apply_account_fail_email(@my_info, error_message) end
- %x(curl -XPOST "#{@send_mail_host}:#{@send_mail_port}/send_mail_text" -d "#{email_message}") + send_mail_url = "#{@send_mail_host}:#{@send_mail_port}/send_mail_text" + RestClient.post send_mail_url, email_message end end