class CapybaraSimpleEmailer
Constants
- VERSION
Public Instance Methods
send_message(params)
click to toggle source
Send message from GMAIL account via capybara!
Example:
params = { from:"from.test.user@gmail.com", pass:"testuser123", to:"to.test.user1@gmail.com", theme:"test.theme", message:"test.message" } >> CapybaraSimpleEmailer.new.send_message(params)
Arguments:
params: (Hash) * required keys - from:, pass:, to:, theme:, message:
# File lib/capybara_simple_emailer.rb, line 27 def send_message(params) begin visit('/') fill_in 'Email', with: params[:from] find("#next").click fill_in 'Password', with: params[:pass] find("#signIn").click find('.T-I-KE.L3').click find('.GS textarea').set(params[:to]) find('.aoT').set(params[:theme]) find('.GP').click find('.Am.Al.editable').set(params[:message]) find('.T-I-atl.L3').click return "Done" rescue return "Error" end end