
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
This gem provide classes for an easy use of the sendrig-ruby official gem.
Ruby version >= 2.4 (except version 2.6.0)
Add this line to your application's Gemfile:
gem 'sendgrid-object'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install sendgrid-object
You need to configure the api key with the following code. You can add it in /config/initializers/sendgrid.rb
for example.
require 'sendgrid-object'
Sendgrid.config do
api_key 'YOUR_API_KEY_HERE'
end
recipient = Sendgrid::Recipient.new()
recipient.find_by("email", "john@doe.com")
=> {"id"=>"ID", "email"=>"john@doe.com", "created_at"=>TIMESTAMP, "updated_at"=>TIMESTAMP, "last_emailed"=>TIMESTAMP, "last_clicked"=>TIMESTAMP, "last_opened"=>TIMESTAMP, "first_name"=>"John", "last_name"=>"Doe"}
unless recipient.errors
puts recipient.id
puts recipient.email
puts recipient.first_name
puts recipient.last_name
end
recipient = Sendgrid::Recipient.new()
recipient.create({ email: "jane@doe.com" })
=> "ID"
unless recipient.errors
puts recipient.id
puts recipient.email
puts recipient.first_name
puts recipient.last_name
end
recipient = Sendgrid::Recipient.new()
recipient.find_by("email", "john@doe.com")
list = Sendgrid::List.new()
list.add_recipient(recipient.id, ID_OF_THE_LIST)
=> nil
unless list.errors
puts "User successfully added."
end
OR
recipient = Sendgrid::Recipient.new()
recipient.find_by("email", "john@doe.com")
list = Sendgrid::List.new()
sendgrid_list.find(ID_OF_THE_LIST)
=> {"id"=>ID_OF_THE_LIST, "name"=>"NAME", "recipient_count"=>NB}
list.add_recipient(recipient.id)
=> nil
puts "User successfully added." unless list.errors
recipient = Sendgrid::Recipient.new()
recipient.find_by("email", "john@doe.com")
=> {"id"=>"ID", "email"=>"john@doe.com", "created_at"=>TIMESTAMP, "updated_at"=>TIMESTAMP, "last_emailed"=>TIMESTAMP, "last_clicked"=>TIMESTAMP, "last_opened"=>TIMESTAMP, "first_name"=>"John", "last_name"=>"Doe"}
unless recipient.errors
recipient.destroy
puts "User successfully destroyed." unless recipient.errors
end
OR
recipient = Sendgrid::Recipient.new()
recipient.destroy("ID")
puts "User successfully destroyed." unless recipient.errors
Bug reports and pull requests are welcome on GitHub at https://github.com/immateriel/sendgrid-object. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that sendgrid-object demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.