
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
= SendGrid SMTP API gem for Rails {}[http://travis-ci.org/kylejginavan/sendgrid_smtpapi]
SendGrid SMTP API gem provides ActionMailer::Base extensions to use SendGrid API features in you emails. It extends ActionMailer with next methods:
substitute(patters_string, array_of_substitunion_strings)
uniq_args(hash_of_unique_args)
category(category_string)
open_tracking(enabled = true)
add_filter_setting(filter_name, setting_name, value)
standard_smtp(enabled = false)
== Rails 3 configuration
In your Gemfile:
gem 'sendgrid_smtpapi'
In your config/environment.rb:
ActionMailer::Base.register_interceptor(SendGridSmtpApi::MailInterceptor)
ActionMailer::Base.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => '25',
:domain => 'example.com',
:authentication => :plain,
:user_name => 'login@example.com',
:password => 'your password'
}
== Usage examples
=== Adding multiple recipients:
class Mailer < ActionMailer::Base
default :from => 'no-reply@example.com',
:subject => 'An email sent via SendGridSmtpApi'
def email_with_multiple_recipients
mail :to => %w(email1@email.com email2@email.com)
end
end
=== Adding substitution vars
Mailer class definition:
class Mailer < ActionMailer::Base
default :from => 'no-reply@example.com',
:subject => 'An email sent via SendGridSmtpApi with substitutions'
def email_with_substitutions
substitute '-user_name-', %w(User1 User2)
mail :to => %w(email1@email.com email2@email.com), :body => "Hello, -user_name-!"
end
end
=== Adding category
Mailer class definition:
class Mailer < ActionMailer::Base
default :from => 'no-reply@example.com',
:subject => 'An email sent via SendGridSmtpApi with substitutions'
def email_with_category
category 'SendGridSmtpApiRocks'
mail :to => 'email1@email.com'
end
end
== Apps (formerly called Filters)
Apps can be applied to any of your email messages and can be configured through SendGridSmtpApi gem.
=== Open Tracking
Add an invisible image at the end of the email to track e-mail opens. If the email recipient has images enabled on the email client, a request to server for the invisible image is executed and an open is logged.
class Mailer < ActionMailer::Base
default :from => 'no-reply@example.com',
:subject => 'An email sent via SendGridSmtpApi'
def email_with_open_tracking_enabled
open_tracking true
mail :to => 'email@email.com'
end
end
=== Use Standard SMTP
if you want to customize the header for sendgrids api but you need keep standard SMTP see below:
class Mailer < ActionMailer::Base
default :from => 'no-reply@example.com',
:subject => 'An email sent via SendGridSmtpApi'
def email_standard_smtp
standard_smtp true
open_tracking true
mail :to => 'email@email.com'
end
end
== CONTRIBUTORS:
FAQs
Unknown package
We found that sendgrid_smtpapi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.