mailer 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +24 -0
- data/Gemfile +13 -0
- data/LICENSE +22 -0
- data/README.md +76 -0
- data/Rakefile +5 -0
- data/doc/Mailer.html +152 -0
- data/doc/Mailer/Client.html +481 -0
- data/doc/Mailer/Config.html +511 -0
- data/doc/_index.html +132 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file.README.html +160 -0
- data/doc/file_list.html +55 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +160 -0
- data/doc/js/app.js +208 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +116 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/mailer.rb +7 -0
- data/lib/mailer/client.rb +61 -0
- data/lib/mailer/config.rb +46 -0
- data/lib/mailer/version.rb +3 -0
- data/mailer.gemspec +20 -0
- data/test/mailer/client_test.rb +72 -0
- data/test/test_helper.rb +2 -0
- metadata +109 -0
data/.gitignore
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
*.sw*
|
2
|
+
*.gem
|
3
|
+
*.rbc
|
4
|
+
.bundle
|
5
|
+
.config
|
6
|
+
coverage
|
7
|
+
Gemfile.lock
|
8
|
+
InstalledFiles
|
9
|
+
.yardoc
|
10
|
+
_yardoc
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
*.sassc
|
15
|
+
.sass-cache
|
16
|
+
capybara-*.html
|
17
|
+
.rspec
|
18
|
+
log/*
|
19
|
+
test/tmp
|
20
|
+
test/version_tmp
|
21
|
+
tmp
|
22
|
+
*.orig
|
23
|
+
rerun.txt
|
24
|
+
pickle-email-*.html
|
data/Gemfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
source "http://gems.undev.cc"
|
3
|
+
|
4
|
+
# Specify your gem's dependencies in mailer.gemspec
|
5
|
+
gemspec
|
6
|
+
gem 'unweary', '~> 1.0.0'
|
7
|
+
|
8
|
+
group :development, :test do
|
9
|
+
gem 'webmock'
|
10
|
+
gem 'json'
|
11
|
+
gem 'turn'
|
12
|
+
gem 'minitest'
|
13
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Andrey Subbota
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# Mailer
|
2
|
+
|
3
|
+
Гем для создания листов рассылки, подписывания пользователей на них и отправки писем в рассылку
|
4
|
+
|
5
|
+
## Установка
|
6
|
+
|
7
|
+
Добавить в Gemfile строки:
|
8
|
+
|
9
|
+
source "http://gems.undev.cc"
|
10
|
+
gem 'mailer'
|
11
|
+
|
12
|
+
Затем запустить:
|
13
|
+
|
14
|
+
$ bundle
|
15
|
+
|
16
|
+
## Использование
|
17
|
+
|
18
|
+
### Настройка
|
19
|
+
|
20
|
+
Для работы гема требуется указать `api_token` и `api_domain` с помощью файла конфигурации
|
21
|
+
|
22
|
+
#config/initializers/mailer.rb
|
23
|
+
Mailer.configure do |config|
|
24
|
+
config.api_token = 'API_TOKEN'
|
25
|
+
config.api_domain = 'http://mailer.st2.ul.home/' # Staging
|
26
|
+
end
|
27
|
+
|
28
|
+
### Создание рассылки
|
29
|
+
|
30
|
+
Для создания рассылки необходимы два параметра:
|
31
|
+
|
32
|
+
* `name` - название рассылки
|
33
|
+
* `id` - ваш идентификатор рассылки по которому она будет идентифицироватся в дальнейшем для подписок пользователей и рассылки писем
|
34
|
+
|
35
|
+
Пример:
|
36
|
+
|
37
|
+
Mailer::Client.new(:api_token => 'API_TOKEN')
|
38
|
+
.create_maillist(
|
39
|
+
:id => 'my_list',
|
40
|
+
:name => 'New mailist name'
|
41
|
+
)
|
42
|
+
|
43
|
+
### Подписка пользователя на рассылку
|
44
|
+
|
45
|
+
Необходимые параметры
|
46
|
+
|
47
|
+
* `id` - ваш идентификатор рассылки
|
48
|
+
* `email` - email пользователя
|
49
|
+
|
50
|
+
Пример:
|
51
|
+
|
52
|
+
Mailer::Client.new(:api_token => 'API_TOKEN')
|
53
|
+
.subscribe_user(
|
54
|
+
:id => 'my_list',
|
55
|
+
:email => 'user@example.com'
|
56
|
+
)
|
57
|
+
|
58
|
+
### Отправка сообщения в рассылку
|
59
|
+
|
60
|
+
Аттрибуты письма:
|
61
|
+
|
62
|
+
* `id` - идентификатор рассылки
|
63
|
+
* `subject` - заголовок письма
|
64
|
+
* `body` - тело письма
|
65
|
+
* `reply_name` - имя отправителя
|
66
|
+
* `reply_email` - email отправителя
|
67
|
+
|
68
|
+
Пример:
|
69
|
+
|
70
|
+
Mailer::Client.new(:api_token =>'API_TOKEN')
|
71
|
+
.send_letter(
|
72
|
+
:id => 'my_list',
|
73
|
+
:subject => 'My spam',
|
74
|
+
:body => 'Меня зовут Бакаре Тунде, я брат первого нигерийского космонавта...'
|
75
|
+
)
|
76
|
+
|
data/Rakefile
ADDED
data/doc/Mailer.html
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Mailer
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.1
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '';
|
20
|
+
framesUrl = "frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="_index.html">Index (M)</a> »
|
35
|
+
|
36
|
+
|
37
|
+
<span class="title">Mailer</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Mailer
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
<dt class="r1">Extended by:</dt>
|
77
|
+
<dd class="r1"><span class='object_link'><a href="Mailer/Config.html" title="Mailer::Config (module)">Config</a></span></dd>
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<dt class="r2 last">Defined in:</dt>
|
86
|
+
<dd class="r2 last">lib/mailer.rb<span class="defines">,<br />
|
87
|
+
lib/mailer/config.rb,<br /> lib/mailer/client.rb,<br /> lib/mailer/version.rb</span>
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
</dl>
|
91
|
+
<div class="clear"></div>
|
92
|
+
|
93
|
+
<h2>Defined Under Namespace</h2>
|
94
|
+
<p class="children">
|
95
|
+
|
96
|
+
|
97
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Mailer/Config.html" title="Mailer::Config (module)">Config</a></span>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Mailer/Client.html" title="Mailer::Client (class)">Client</a></span>
|
102
|
+
|
103
|
+
|
104
|
+
</p>
|
105
|
+
|
106
|
+
<h2>Constant Summary</h2>
|
107
|
+
|
108
|
+
<dl class="constants">
|
109
|
+
|
110
|
+
<dt id="VERSION-constant" class="">VERSION =
|
111
|
+
|
112
|
+
</dt>
|
113
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.0.2</span><span class='tstring_end'>"</span></span></pre></dd>
|
114
|
+
|
115
|
+
</dl>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
<h3 class="inherited">Constants included
|
123
|
+
from <span class='object_link'><a href="Mailer/Config.html" title="Mailer::Config (module)">Config</a></span></h3>
|
124
|
+
<p class="inherited"><span class='object_link'><a href="Mailer/Config.html#DEFAULT_API_DOMAIN-constant" title="Mailer::Config::DEFAULT_API_DOMAIN (constant)">Config::DEFAULT_API_DOMAIN</a></span>, <span class='object_link'><a href="Mailer/Config.html#DEFAULT_API_TOKEN-constant" title="Mailer::Config::DEFAULT_API_TOKEN (constant)">Config::DEFAULT_API_TOKEN</a></span>, <span class='object_link'><a href="Mailer/Config.html#VALID_OPTIONS_KEYS-constant" title="Mailer::Config::VALID_OPTIONS_KEYS (constant)">Config::VALID_OPTIONS_KEYS</a></span></p>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<h2>Method Summary</h2>
|
138
|
+
|
139
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Mailer/Config.html" title="Mailer::Config (module)">Config</a></span></h3>
|
140
|
+
<p class="inherited"><span class='object_link'><a href="Mailer/Config.html#configure-instance_method" title="Mailer::Config#configure (method)">configure</a></span>, <span class='object_link'><a href="Mailer/Config.html#extended-class_method" title="Mailer::Config.extended (method)">extended</a></span>, <span class='object_link'><a href="Mailer/Config.html#options-instance_method" title="Mailer::Config#options (method)">options</a></span>, <span class='object_link'><a href="Mailer/Config.html#reset-instance_method" title="Mailer::Config#reset (method)">reset</a></span></p>
|
141
|
+
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<div id="footer">
|
146
|
+
Generated on Tue May 29 13:58:48 2012 by
|
147
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
148
|
+
0.8.1 (ruby-1.9.3).
|
149
|
+
</div>
|
150
|
+
|
151
|
+
</body>
|
152
|
+
</html>
|
@@ -0,0 +1,481 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Mailer::Client
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.1
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (C)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Mailer.html" title="Mailer (module)">Mailer</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Client</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: Mailer::Client
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Weary::Client</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">Weary::Client</li>
|
82
|
+
|
83
|
+
<li class="next">Mailer::Client</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dt class="r2 last">Defined in:</dt>
|
99
|
+
<dd class="r2 last">lib/mailer/client.rb</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<h2>
|
113
|
+
Instance Method Summary
|
114
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
115
|
+
</h2>
|
116
|
+
|
117
|
+
<ul class="summary">
|
118
|
+
|
119
|
+
<li class="public ">
|
120
|
+
<span class="summary_signature">
|
121
|
+
|
122
|
+
<a href="#create_maillist-instance_method" title="#create_maillist (instance method)">- (Object) <strong>create_maillist</strong>(params) </a>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
</span>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<span class="summary_desc"><div class='inline'>
|
137
|
+
<p>Create maillist.</p>
|
138
|
+
</div></span>
|
139
|
+
|
140
|
+
</li>
|
141
|
+
|
142
|
+
|
143
|
+
<li class="public ">
|
144
|
+
<span class="summary_signature">
|
145
|
+
|
146
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Client) <strong>initialize</strong>(attrs = {}) </a>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
</span>
|
151
|
+
|
152
|
+
|
153
|
+
<span class="note title constructor">constructor</span>
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
<span class="summary_desc"><div class='inline'>
|
163
|
+
<p>A new instance of Client.</p>
|
164
|
+
</div></span>
|
165
|
+
|
166
|
+
</li>
|
167
|
+
|
168
|
+
|
169
|
+
<li class="public ">
|
170
|
+
<span class="summary_signature">
|
171
|
+
|
172
|
+
<a href="#send_letter-instance_method" title="#send_letter (instance method)">- (Object) <strong>send_letter</strong>(params) </a>
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
</span>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
<span class="summary_desc"><div class='inline'>
|
187
|
+
<p>Send email over maillist.</p>
|
188
|
+
</div></span>
|
189
|
+
|
190
|
+
</li>
|
191
|
+
|
192
|
+
|
193
|
+
<li class="public ">
|
194
|
+
<span class="summary_signature">
|
195
|
+
|
196
|
+
<a href="#subscribe_user-instance_method" title="#subscribe_user (instance method)">- (Object) <strong>subscribe_user</strong>(params) </a>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
</span>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
<span class="summary_desc"><div class='inline'>
|
211
|
+
<p>Subscriber email to maillist.</p>
|
212
|
+
</div></span>
|
213
|
+
|
214
|
+
</li>
|
215
|
+
|
216
|
+
|
217
|
+
</ul>
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
<div id="constructor_details" class="method_details_list">
|
222
|
+
<h2>Constructor Details</h2>
|
223
|
+
|
224
|
+
<div class="method_details first">
|
225
|
+
<h3 class="signature first" id="initialize-instance_method">
|
226
|
+
|
227
|
+
- (<tt><span class='object_link'><a href="" title="Mailer::Client (class)">Client</a></span></tt>) <strong>initialize</strong>(attrs = {})
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
</h3><div class="docstring">
|
234
|
+
<div class="discussion">
|
235
|
+
|
236
|
+
<p>A new instance of Client</p>
|
237
|
+
|
238
|
+
|
239
|
+
</div>
|
240
|
+
</div>
|
241
|
+
<div class="tags">
|
242
|
+
|
243
|
+
|
244
|
+
</div><table class="source_code">
|
245
|
+
<tr>
|
246
|
+
<td>
|
247
|
+
<pre class="lines">
|
248
|
+
|
249
|
+
|
250
|
+
9
|
251
|
+
10
|
252
|
+
11
|
253
|
+
12
|
254
|
+
13
|
255
|
+
14</pre>
|
256
|
+
</td>
|
257
|
+
<td>
|
258
|
+
<pre class="code"><span class="info file"># File 'lib/mailer/client.rb', line 9</span>
|
259
|
+
|
260
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
261
|
+
<span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='const'>Mailer</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span>
|
262
|
+
<span class='const'>Config</span><span class='op'>::</span><span class='const'>VALID_OPTIONS_KEYS</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span>
|
263
|
+
<span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='comma'>,</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
264
|
+
<span class='kw'>end</span>
|
265
|
+
<span class='kw'>end</span></pre>
|
266
|
+
</td>
|
267
|
+
</tr>
|
268
|
+
</table>
|
269
|
+
</div>
|
270
|
+
|
271
|
+
</div>
|
272
|
+
|
273
|
+
|
274
|
+
<div id="instance_method_details" class="method_details_list">
|
275
|
+
<h2>Instance Method Details</h2>
|
276
|
+
|
277
|
+
|
278
|
+
<div class="method_details first">
|
279
|
+
<h3 class="signature first" id="create_maillist-instance_method">
|
280
|
+
|
281
|
+
- (<tt>Object</tt>) <strong>create_maillist</strong>(params)
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
</h3><div class="docstring">
|
288
|
+
<div class="discussion">
|
289
|
+
|
290
|
+
<p>Create maillist</p>
|
291
|
+
|
292
|
+
|
293
|
+
</div>
|
294
|
+
</div>
|
295
|
+
<div class="tags">
|
296
|
+
<p class="tag_title">Parameters:</p>
|
297
|
+
<ul class="param">
|
298
|
+
|
299
|
+
<li>
|
300
|
+
|
301
|
+
<span class='name'>params</span>
|
302
|
+
|
303
|
+
|
304
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
</li>
|
309
|
+
|
310
|
+
</ul>
|
311
|
+
|
312
|
+
|
313
|
+
</div><table class="source_code">
|
314
|
+
<tr>
|
315
|
+
<td>
|
316
|
+
<pre class="lines">
|
317
|
+
|
318
|
+
|
319
|
+
55
|
320
|
+
56
|
321
|
+
57
|
322
|
+
58
|
323
|
+
59</pre>
|
324
|
+
</td>
|
325
|
+
<td>
|
326
|
+
<pre class="code"><span class="info file"># File 'lib/mailer/client.rb', line 55</span>
|
327
|
+
|
328
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_create_maillist'>create_maillist</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
|
329
|
+
<span class='id identifier rubyid_request'>request</span> <span class='op'>=</span> <span class='id identifier rubyid_create_maillist_request'>create_maillist_request</span><span class='lparen'>(</span><span class='symbol'>:api_token</span> <span class='op'>=></span> <span class='ivar'>@api_token</span><span class='comma'>,</span> <span class='symbol'>:list</span> <span class='op'>=></span> <span class='lbrace'>{</span><span class='symbol'>:name</span> <span class='op'>=></span> <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:id</span> <span class='op'>=></span> <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:id</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_perform'>perform</span>
|
330
|
+
|
331
|
+
<span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
|
332
|
+
<span class='kw'>end</span></pre>
|
333
|
+
</td>
|
334
|
+
</tr>
|
335
|
+
</table>
|
336
|
+
</div>
|
337
|
+
|
338
|
+
<div class="method_details ">
|
339
|
+
<h3 class="signature " id="send_letter-instance_method">
|
340
|
+
|
341
|
+
- (<tt>Object</tt>) <strong>send_letter</strong>(params)
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
</h3><div class="docstring">
|
348
|
+
<div class="discussion">
|
349
|
+
|
350
|
+
<p>Send email over maillist</p>
|
351
|
+
|
352
|
+
|
353
|
+
</div>
|
354
|
+
</div>
|
355
|
+
<div class="tags">
|
356
|
+
<p class="tag_title">Parameters:</p>
|
357
|
+
<ul class="param">
|
358
|
+
|
359
|
+
<li>
|
360
|
+
|
361
|
+
<span class='name'>params</span>
|
362
|
+
|
363
|
+
|
364
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
</li>
|
369
|
+
|
370
|
+
</ul>
|
371
|
+
|
372
|
+
|
373
|
+
</div><table class="source_code">
|
374
|
+
<tr>
|
375
|
+
<td>
|
376
|
+
<pre class="lines">
|
377
|
+
|
378
|
+
|
379
|
+
31
|
380
|
+
32
|
381
|
+
33
|
382
|
+
34
|
383
|
+
35
|
384
|
+
36
|
385
|
+
37
|
386
|
+
38
|
387
|
+
39
|
388
|
+
40
|
389
|
+
41</pre>
|
390
|
+
</td>
|
391
|
+
<td>
|
392
|
+
<pre class="code"><span class="info file"># File 'lib/mailer/client.rb', line 31</span>
|
393
|
+
|
394
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_send_letter'>send_letter</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
|
395
|
+
<span class='id identifier rubyid_letter'>letter</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
396
|
+
<span class='lbracket'>[</span><span class='symbol'>:subject</span><span class='comma'>,</span> <span class='symbol'>:body</span><span class='comma'>,</span> <span class='symbol'>:reply_name</span><span class='comma'>,</span> <span class='symbol'>:reply_email</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span>
|
397
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
|
398
|
+
<span class='id identifier rubyid_letter'>letter</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
|
399
|
+
<span class='kw'>end</span>
|
400
|
+
<span class='kw'>end</span>
|
401
|
+
<span class='id identifier rubyid_request'>request</span> <span class='op'>=</span> <span class='id identifier rubyid_send_letter_request'>send_letter_request</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='symbol'>:letter</span> <span class='op'>=></span> <span class='id identifier rubyid_letter'>letter</span><span class='comma'>,</span> <span class='symbol'>:api_token</span> <span class='op'>=></span> <span class='ivar'>@api_token</span><span class='comma'>,</span> <span class='symbol'>:id</span> <span class='op'>=></span> <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:id</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_perform'>perform</span>
|
402
|
+
|
403
|
+
<span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
|
404
|
+
<span class='kw'>end</span></pre>
|
405
|
+
</td>
|
406
|
+
</tr>
|
407
|
+
</table>
|
408
|
+
</div>
|
409
|
+
|
410
|
+
<div class="method_details ">
|
411
|
+
<h3 class="signature " id="subscribe_user-instance_method">
|
412
|
+
|
413
|
+
- (<tt>Object</tt>) <strong>subscribe_user</strong>(params)
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
</h3><div class="docstring">
|
420
|
+
<div class="discussion">
|
421
|
+
|
422
|
+
<p>Subscriber email to maillist</p>
|
423
|
+
|
424
|
+
|
425
|
+
</div>
|
426
|
+
</div>
|
427
|
+
<div class="tags">
|
428
|
+
<p class="tag_title">Parameters:</p>
|
429
|
+
<ul class="param">
|
430
|
+
|
431
|
+
<li>
|
432
|
+
|
433
|
+
<span class='name'>params</span>
|
434
|
+
|
435
|
+
|
436
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
</li>
|
441
|
+
|
442
|
+
</ul>
|
443
|
+
|
444
|
+
|
445
|
+
</div><table class="source_code">
|
446
|
+
<tr>
|
447
|
+
<td>
|
448
|
+
<pre class="lines">
|
449
|
+
|
450
|
+
|
451
|
+
46
|
452
|
+
47
|
453
|
+
48
|
454
|
+
49
|
455
|
+
50</pre>
|
456
|
+
</td>
|
457
|
+
<td>
|
458
|
+
<pre class="code"><span class="info file"># File 'lib/mailer/client.rb', line 46</span>
|
459
|
+
|
460
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_subscribe_user'>subscribe_user</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
|
461
|
+
<span class='id identifier rubyid_request'>request</span> <span class='op'>=</span> <span class='id identifier rubyid_subscribe_user_request'>subscribe_user_request</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='symbol'>:api_token</span> <span class='op'>=></span> <span class='ivar'>@api_token</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_perform'>perform</span>
|
462
|
+
|
463
|
+
<span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
|
464
|
+
<span class='kw'>end</span></pre>
|
465
|
+
</td>
|
466
|
+
</tr>
|
467
|
+
</table>
|
468
|
+
</div>
|
469
|
+
|
470
|
+
</div>
|
471
|
+
|
472
|
+
</div>
|
473
|
+
|
474
|
+
<div id="footer">
|
475
|
+
Generated on Tue May 29 13:58:48 2012 by
|
476
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
477
|
+
0.8.1 (ruby-1.9.3).
|
478
|
+
</div>
|
479
|
+
|
480
|
+
</body>
|
481
|
+
</html>
|