Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
228 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
== 1.1.0 / 2009-02-10 | ||
* Converted plugin into a Rubygem with a Rails generator. | ||
* Updated README with installation details. | ||
|
||
== 1.0.0 / 2009-02-09 | ||
* Tagging original SVN migration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2009 OpenRain, LLC | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
ActionMailerTLS | ||
=============== | ||
|
||
Background | ||
---------- | ||
|
||
This Ruby on Rails plugin makes it trivial to send email through a Google Apps for business account. | ||
|
||
This gem will only work on Ruby 1.8.6. | ||
|
||
Installation | ||
------------ | ||
|
||
If you're on Ruby 1.8.7 and Rails >= 2.2.1, you don't need this plugin. See Notes below. | ||
|
||
To install the gem (the preferred way): | ||
|
||
1. sudo gem install openrain-action_mailer_tls -s http://gems.github.com | ||
2. ./script/generate action_mailer_tls | ||
3. Copy RAILS_ROOT/config/smtp_gmail.yml.sample to RAILS_ROOT/config/smtp_gmail.yml | ||
4. Update the configuration file with your settings | ||
|
||
To (optionally) vendor this gem | ||
1. Add config.gem "openrain-action_mailer_tls", :source => "http://gems.github.com" | ||
2. rake gems:unpack | ||
|
||
To install the plugin (the old way) | ||
|
||
1. ./script/plugin install git://github.com/openrain/action_mailer_tls.git -r '1.0.0' | ||
2. Copy vendor/plugins/action_mailer_tls/sample/smtp_gmail.rb to config/ | ||
3. Copy vendor/plugins/action_mailer_tls/sample/mailer.yml.sample to config/ | ||
4. Update the configuration file with your settings | ||
|
||
Testing it out | ||
-------------- | ||
|
||
1. ./script/generate mailer Notifier hello_world | ||
2. Add the following lines to config/environments/development.rb | ||
config.action_mailer.raise_delivery_errors = true | ||
config.action_mailer.perform_deliveries = true | ||
config.action_mailer.delivery_method = :smtp | ||
3. Update the recipients and from fields in app/models/notifier.rb | ||
4. ./script/console | ||
5. >> Notifier.deliver_hello_world! | ||
Resources | ||
--------- | ||
|
||
Blog posts | ||
|
||
* http://www.rubyinside.com/how-to-use-gmails-smtp-server-with-rails-394.html | ||
* http://www.prestonlee.com/archives/63 | ||
|
||
Books | ||
|
||
* Advanced Rails Recipes pg. 238, Recipe #47. | ||
|
||
Notes | ||
----- | ||
|
||
If you're running Rails >= 2.2.1 [RC2] and Ruby 1.8.7, you don't need this plugin. Ruby 1.8.7 supports | ||
SMTP TLS and Rails 2.2.1 ships with an option to enable it if you're running Ruby 1.8.7. | ||
|
||
To set it all up, in config/initializers/smtp_gmail.rb: | ||
ActionMailer::Base.smtp_settings = { | ||
:address => "smtp.gmail.com", | ||
:port => 587, | ||
:authentication => :plain, | ||
:enable_starttls_auto => true | ||
:user_name: your_username@gmail.com | ||
:password: h@ckme | ||
} | ||
|
||
http://github.com/rails/rails/commit/732c724df61bc8b780dc42817625b25a321908e4 | ||
|
||
Author | ||
------ | ||
* Marc Chung - marc [dot] chung [at] openrain [dot] com | ||
|
||
License | ||
------- | ||
* Copyright (c) 2009 OpenRain, LLC. See MIT-LICENSE for details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
begin | ||
require 'jeweler' | ||
Jeweler::Tasks.new do |s| | ||
s.name = "action_mailer_tls" | ||
s.summary = "Send Email via Gmail" | ||
s.email = "marc.chung@openrain.com" | ||
s.homepage = "http://github.com/openrain/action_mailer_tls" | ||
s.description = "Conveniently send emails through Google's Hosted App service" | ||
s.authors = ["Marc Chung"] | ||
s.files = FileList["[A-Z]*.*", "{bin,generators,lib,test,spec}/**/*"] | ||
end | ||
rescue LoadError | ||
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com" | ||
end | ||
|
||
require 'rake/rdoctask' | ||
Rake::RDocTask.new do |rdoc| | ||
rdoc.rdoc_dir = 'rdoc' | ||
rdoc.title = 'action_mailer_tls' | ||
rdoc.options << '--line-numbers' << '--inline-source' | ||
rdoc.rdoc_files.include('README*') | ||
rdoc.rdoc_files.include('lib/**/*.rb') | ||
end | ||
|
||
# require 'rake/testtask' | ||
# Rake::TestTask.new(:test) do |t| | ||
# t.libs << 'lib' << 'test' | ||
# t.pattern = 'test/**/*_test.rb' | ||
# t.verbose = false | ||
# end | ||
# | ||
# begin | ||
# require 'rcov/rcovtask' | ||
# Rcov::RcovTask.new do |t| | ||
# t.libs << 'test' | ||
# t.test_files = FileList['test/**/*_test.rb'] | ||
# t.verbose = true | ||
# end | ||
# rescue LoadError | ||
# puts "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov" | ||
# end | ||
|
||
task :default => :test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
:patch: 0 | ||
:major: 1 | ||
:minor: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- encoding: utf-8 -*- | ||
|
||
Gem::Specification.new do |s| | ||
s.name = %q{action_mailer_tls} | ||
s.version = "1.1.0" | ||
|
||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | ||
s.authors = ["Marc Chung"] | ||
s.date = %q{2009-02-10} | ||
s.description = %q{Conveniently send emails through Google's Hosted App service} | ||
s.email = %q{marc.chung@openrain.com} | ||
s.files = ["History.txt", "README.markdown", "VERSION.yml", "generators/USAGE", "generators/action_mailer_tls_generator.rb", "generators/templates", "generators/templates/config", "generators/templates/config/initializers", "generators/templates/config/initializers/smtp_gmail.rb", "generators/templates/config/smtp_gmail.yml.sample", "lib/smtp_tls.rb"] | ||
s.has_rdoc = true | ||
s.homepage = %q{http://github.com/openrain/action_mailer_tls} | ||
s.rdoc_options = ["--inline-source", "--charset=UTF-8"] | ||
s.require_paths = ["lib"] | ||
s.rubygems_version = %q{1.3.1} | ||
s.summary = %q{Send Email via Gmail} | ||
|
||
if s.respond_to? :specification_version then | ||
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION | ||
s.specification_version = 2 | ||
|
||
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then | ||
else | ||
end | ||
else | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Description: | ||
The action_mailer_tls generator adds smtp-tls support to your Rails projects. | ||
|
||
The generator takes no arguments and only needs to be run once. It will create | ||
a Rails initializer for Gmail, and a sample YAML configuration file. | ||
|
||
Modify the contents of the configuration file with your Gmail username and | ||
password | ||
|
||
Example: | ||
./script/generate action_mailer_tls | ||
|
||
This will create the following files: | ||
Initializer: config/initializers/smtp_gmail.rb | ||
Config: config/smtp_gmail.yml.sample | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This generator intalls ActionMailerTLS into a Rails project | ||
class ActionMailerTlsGenerator < Rails::Generator::Base | ||
|
||
def manifest | ||
record do |m| | ||
m.file "config/smtp_gmail.yml.sample", "config/smtp_gmail.yml.sample" | ||
m.file "config/initializers/smtp_gmail.rb", "config/initializers/smtp_gmail.rb" | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This file is automatically copied into RAILS_ROOT/initializers | ||
|
||
require "smtp_tls" | ||
|
||
config_file = "#{RAILS_ROOT}/config/smtp_gmail.yml" | ||
raise "Sorry, you must have #{config_file}" unless File.exists?(config_file) | ||
|
||
config_options = YAML.load_file(config_file) | ||
ActionMailer::Base.smtp_settings = { | ||
:address => "smtp.gmail.com", | ||
:port => 587, | ||
:authentication => :plain, | ||
:enable_starttls_auto => true | ||
}.merge(config_options) # Configuration options override default options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
:user_name: your_username@gmail.com | ||
:password: h@ckme |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.