0.0
No commit activity in last 3 years
No release in over 3 years
Ruby gem to get mail from guerrillamail.com. With this gem you can use guerrillamail APIs and verify subject and body of received emails.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 10.0

Runtime

~> 5.0, >= 5.0.0.1
~> 2.1
>= 2.1.0
 Project Readme

GuerrillaMailX

guerrilla_mailX provides easy methods to call guerilla_mail API's and also you can easily verify subject and body of any mail received over the guerrila_mail.

It is very helpful in testing of mails.

Installation

Add this line to your application's Gemfile:

gem 'guerrilla_mailX'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install guerrilla_mailX

Getting started


Get new random mail Id:

You can use Guerrilla.new to get random email id which will be active only for 1 hour. This method returns an object with attributes: sid_token, email, time timestamp, alias_id and valid_till

> guerrilla_mail = Guerrilla.new

You can also set your custom email:

> guerrilla_mail = Guerrilla.new(custom_test)
To verify last received mail:

verify_last_mail can be used to verify body and subject of last mail received.

> guerrilla_mail.verify_last_mail(subject: "Welcome to guerrilla_mail")

While subject: is required argument and body: is optional. This method will return true for subject, if given string is present in last mail. Default wait time is 120 seconds, which you can change by argument wait:

If you want to verify particular mail by offset in a list you can use:

> guerrilla_mail.verify_mail(subject: "Welcome to guerrilla_mail", offset: 3)

This will test 3rd email from last recently received mail. You can also provide email_id: if you dont want to use offset. You will get email_id from get_email_list method. In this wait time is also 120 sec but you can change it by providing wait: argument. You can also provide body: argument that takes a string and check if it is present in a mail body. This method returns hash for subject and body, if present they are set to true else false.

Methods available
  • initialize
  • set_email_user
  • verify_last_mail
  • verify_mail
  • check_email
  • get_email_list
  • fetch_email
  • forget_me
  • del_email
  • get_older_list

All these method can take sid_token: argument and then work for that sid_token.

Class methods available
  • get_email_address
  • forget_me
  • del_email
Reference

You can check Guerrilla Mail API and argument it takes from Guerrilla Mail JSON API

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/himanshu-thinkfuture/guerrilla_mailX. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the GuerrillaMailX project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.