mailbag 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/README.md +20 -0
- data/Rakefile +1 -0
- data/config/initializers/mailbag.rb +7 -0
- data/lib/generators/mailbag_generator.rb +13 -0
- data/lib/generators/templates/create_email_logs.rb +18 -0
- data/lib/mailbag/rails/engine.rb +6 -0
- data/lib/mailbag/rails/version.rb +5 -0
- data/lib/mailbag/rails.rb +2 -0
- data/lib/mailbag.rb +1 -0
- data/mailbag.gemspec +22 -0
- metadata +90 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# mailbag
|
2
|
+
|
3
|
+
This gem logs email sent by a Rails application to a database table.
|
4
|
+
|
5
|
+
### Installation
|
6
|
+
|
7
|
+
In your Gemfile, add this line:
|
8
|
+
|
9
|
+
gem "mailbag"
|
10
|
+
|
11
|
+
Then, run `bundle install`.
|
12
|
+
|
13
|
+
Run the generator and migrate:
|
14
|
+
|
15
|
+
rails g mailbag
|
16
|
+
rake db:migrate
|
17
|
+
|
18
|
+
### Usage
|
19
|
+
|
20
|
+
You don't have to do anything. Any mail sent out by ActionMailer will be logged to the email_logs table. EmailLog is a standard ActiveRecord model that you can use to interact with your email log.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'rails/generators/active_record'
|
3
|
+
|
4
|
+
class MailbagGenerator < Rails::Generators::Base
|
5
|
+
include Rails::Generators::Migration
|
6
|
+
extend ActiveRecord::Generators::Migration
|
7
|
+
|
8
|
+
source_root File.expand_path('../templates', __FILE__)
|
9
|
+
|
10
|
+
def copy_files(*args)
|
11
|
+
migration_template 'create_email_logs.rb', 'db/migrate/create_email_logs.rb'
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateEmailLogs < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :email_logs do |t|
|
4
|
+
t.string :to
|
5
|
+
t.string :from
|
6
|
+
t.string :subject
|
7
|
+
t.text :body
|
8
|
+
t.datetime :created_at
|
9
|
+
end
|
10
|
+
|
11
|
+
add_index :email_logs, :to
|
12
|
+
add_index :email_logs, :from
|
13
|
+
end
|
14
|
+
|
15
|
+
def down
|
16
|
+
drop_table :email_logs
|
17
|
+
end
|
18
|
+
end
|
data/lib/mailbag.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "mailbag/rails"
|
data/mailbag.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "mailbag/rails/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "mailbag"
|
7
|
+
s.version = Mailbag::Rails::VERSION
|
8
|
+
s.authors = ["John Colvin"]
|
9
|
+
s.email = ["colvin.john@gmail.com"]
|
10
|
+
s.homepage = "https://github.com/JohnColvin/mailbag"
|
11
|
+
s.summary = %q{Rails gem that logs outgoing mail to a database table}
|
12
|
+
s.description = %q{Mailbag keeps track of the emails that your application sends out by logging them to a database table}
|
13
|
+
|
14
|
+
s.rubyforge_project = "mailbag"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.add_dependency "actionmailer", "~> 3.2.1"
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mailbag
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- John Colvin
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2012-02-20 00:00:00 -05:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: actionmailer
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 3
|
30
|
+
- 2
|
31
|
+
- 1
|
32
|
+
version: 3.2.1
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
description: Mailbag keeps track of the emails that your application sends out by logging them to a database table
|
36
|
+
email:
|
37
|
+
- colvin.john@gmail.com
|
38
|
+
executables: []
|
39
|
+
|
40
|
+
extensions: []
|
41
|
+
|
42
|
+
extra_rdoc_files: []
|
43
|
+
|
44
|
+
files:
|
45
|
+
- .gitignore
|
46
|
+
- Gemfile
|
47
|
+
- README.md
|
48
|
+
- Rakefile
|
49
|
+
- config/initializers/mailbag.rb
|
50
|
+
- lib/generators/mailbag_generator.rb
|
51
|
+
- lib/generators/templates/create_email_logs.rb
|
52
|
+
- lib/mailbag.rb
|
53
|
+
- lib/mailbag/rails.rb
|
54
|
+
- lib/mailbag/rails/engine.rb
|
55
|
+
- lib/mailbag/rails/version.rb
|
56
|
+
- mailbag.gemspec
|
57
|
+
has_rdoc: true
|
58
|
+
homepage: https://github.com/JohnColvin/mailbag
|
59
|
+
licenses: []
|
60
|
+
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options: []
|
63
|
+
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
segments:
|
80
|
+
- 0
|
81
|
+
version: "0"
|
82
|
+
requirements: []
|
83
|
+
|
84
|
+
rubyforge_project: mailbag
|
85
|
+
rubygems_version: 1.3.7
|
86
|
+
signing_key:
|
87
|
+
specification_version: 3
|
88
|
+
summary: Rails gem that logs outgoing mail to a database table
|
89
|
+
test_files: []
|
90
|
+
|