pipeline-mail_queue 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/mail_queue.rb +5 -0
- data/lib/mail_queue.rb +26 -0
- data/lib/mail_queue/version.rb +3 -0
- data/mail_queue-0.0.1.gem +0 -0
- data/mail_queue.gemspec +22 -0
- metadata +77 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a613450e1d5a9a65cb45469460be24a95237b235
|
4
|
+
data.tar.gz: fff4419a47f766ce4c6cd42dcaae3aab832cefbf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ef43912d60afc652abd6151385646bad9f4e014a13e8eb0e7c70414204491a4b283a8f07fc8a743681151c400cd33cf69a0e76b9534bed00de8c8d5c17b9b479
|
7
|
+
data.tar.gz: 915f25a847e766d882a7e4740c54508842060a42b725888dfa70e0fb3ee2e283fa1952f3d7b47182f233708fdbcf2ee648b9109e1b107e77639ef1dd82b96a87
|
data/bin/mail_queue.rb
ADDED
data/lib/mail_queue.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# Useful resource:
|
2
|
+
# http://stackoverflow.com/questions/12884711/how-to-send-email-via-smtp-with-rubys-mail-gem
|
3
|
+
|
4
|
+
require 'mail'
|
5
|
+
require 'pipeline/plugin'
|
6
|
+
|
7
|
+
module MailQueue
|
8
|
+
class Consumer < Pipeline::Plugin
|
9
|
+
QUEUES = {emails: 'emails.#'}
|
10
|
+
|
11
|
+
def run
|
12
|
+
config = self.config(:smtp)
|
13
|
+
|
14
|
+
Mail.defaults do
|
15
|
+
puts "~ Starting with #{config.inspect}."
|
16
|
+
delivery_method :smtp, config
|
17
|
+
end
|
18
|
+
|
19
|
+
client.consumer('emails', 'emails.#') do |blob, header, frame|
|
20
|
+
mail = Mail.new(blob)
|
21
|
+
puts "~ Sending email to #{mail.to}"
|
22
|
+
mail.deliver
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
Binary file
|
data/mail_queue.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env gem build
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift(File.expand_path('../lib', __FILE__))
|
4
|
+
|
5
|
+
require 'mail_queue/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = 'pipeline-mail_queue'
|
9
|
+
s.version = MailQueue::VERSION
|
10
|
+
s.authors = ['@botanicus']
|
11
|
+
s.homepage = 'http://github.com/botanicus/mail_queue'
|
12
|
+
s.summary = "Pipeline.rb plugin for sending emails through Gmail SMTP."
|
13
|
+
# s.description = "#{s.summary}. "
|
14
|
+
s.email = 'james@101ideas.cz'
|
15
|
+
s.files = Dir.glob('**/*')
|
16
|
+
s.license = 'MIT'
|
17
|
+
s.require_paths = ['lib']
|
18
|
+
s.executables = 'mail_queue.rb'
|
19
|
+
|
20
|
+
s.add_dependency 'pipeline.rb'
|
21
|
+
s.add_dependency 'mail'
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pipeline-mail_queue
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- '@botanicus'
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-01-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pipeline.rb
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mail
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description:
|
42
|
+
email: james@101ideas.cz
|
43
|
+
executables:
|
44
|
+
- mail_queue.rb
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- bin/mail_queue.rb
|
49
|
+
- lib/mail_queue/version.rb
|
50
|
+
- lib/mail_queue.rb
|
51
|
+
- mail_queue-0.0.1.gem
|
52
|
+
- mail_queue.gemspec
|
53
|
+
homepage: http://github.com/botanicus/mail_queue
|
54
|
+
licenses:
|
55
|
+
- MIT
|
56
|
+
metadata: {}
|
57
|
+
post_install_message:
|
58
|
+
rdoc_options: []
|
59
|
+
require_paths:
|
60
|
+
- lib
|
61
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
requirements: []
|
72
|
+
rubyforge_project:
|
73
|
+
rubygems_version: 2.0.3
|
74
|
+
signing_key:
|
75
|
+
specification_version: 4
|
76
|
+
summary: Pipeline.rb plugin for sending emails through Gmail SMTP.
|
77
|
+
test_files: []
|