README.rdoc in sendgrid-rails-2.0.2 vs README.rdoc in sendgrid-rails-2.0.3
- old
+ new
@@ -1,6 +1,6 @@
-= SendGrid gem for Rails
+= SendGrid gem for Rails 3 {<img src="https://secure.travis-ci.org/PavelTyk/sendgrid-rails.png" />}[http://travis-ci.org/PavelTyk/sendgrid-rails]
SendGrid 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)
@@ -13,11 +13,11 @@
In your Gemfile:
gem 'sendgrid-rails', '~> 2.0'
-In your config/environment.rb:
+In config/initializers/mail.rb:
ActionMailer::Base.register_interceptor(SendGrid::MailInterceptor)
ActionMailer::Base.smtp_settings = {
:address => 'smtp.sendgrid.net',
@@ -26,10 +26,21 @@
:authentication => :plain,
:user_name => 'login@example.com',
:password => 'your password'
}
+=== Overriding default recipient in standard SMTP header
+
+Dummy recipient email used in sent email's "To" header and seen in received email's Received header.
+By deefault set to 'dummy@email.com'
+
+In config/initializers/mail.rb:
+
+ SendGrid.configure do |config|
+ config.dummy_recipient = 'noreply@example.com'
+ end
+
== Usage examples
=== Adding multiple recipients:
class Mailer < ActionMailer::Base
@@ -56,21 +67,21 @@
end
end
=== Adding category
- Mailer class definition:
+Mailer class definition:
- class Mailer < ActionMailer::Base
- default :from => 'no-reply@example.com',
- :subject => 'An email sent via SendGrid with substitutions'
+ class Mailer < ActionMailer::Base
+ default :from => 'no-reply@example.com',
+ :subject => 'An email sent via SendGrid with substitutions'
- def email_with_category
- category 'SendGridRocks'
- mail :to => 'email1@email.com'
- end
- end
+ def email_with_category
+ category 'SendGridRocks'
+ 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 SendGrid gem.
@@ -87,9 +98,17 @@
mail :to => 'email@email.com'
end
end
== Change log
+
+*v2.0.2*
+
+* ApiHeader#to_json wraps array items with spaces
+
+*v2.0.1*
+
+* Standard SMTP To attribute set to 'dummy@email.com' after recipients added to X-SMTPAPI header
*v2.0*
* Using mail interceptor
* ActionMailer::Base#add_recipients - removed