contactus 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3213c8e94234c29cb803843ccb8da865c6d3e39b
4
- data.tar.gz: a53bfaf1530e4cbc21891206bd05ab8871fbc6f5
3
+ metadata.gz: 70aec52d5123a3d894063298a18d971b006fb423
4
+ data.tar.gz: 9fc13d0fe72851560716962940d035a1c5133800
5
5
  SHA512:
6
- metadata.gz: 8d0a46381c07ace550f26f4036e06812034a1c2b3170180c16f3692087003a3bb9b35d836165fbd5df6ead8b74411f1104ac4668b23e9f757e57d336c374cd09
7
- data.tar.gz: 5fff18731845e27020ebe2cf00fbbba615c2e853ed8cf3db440950721f31833ff7580920da555aca2b2ee5c7972924c11fe97363fb3292e0d302e3a04df49b34
6
+ metadata.gz: fb439587e6c0620203035e5beae70535fc1d452016b9f3d98f9da4a72cdc8fe6772d1c5a2ccb0a1f726d144a63cf4c50bf8555f9b8d2b9a96ed2802ddedc906b
7
+ data.tar.gz: 8be86be57f330bb026b77f91a717f5279bafc346e51b5eefea39e282e327ad204b6d934cfcac778f4633e95daf4f8c824a4eb94b545570d47ba0ffef74c5223c
@@ -33,4 +33,7 @@ There will be a initializer file called contactus.rb, where you can configure th
33
33
  #config.extra_fields = %w(city phone)
34
34
 
35
35
  # Configure extra required fields
36
- #config.required_extra_fields = %w(country address)
36
+ #config.required_extra_fields = %w(country address)
37
+
38
+ # From address email, if this variable is not used the contact email will be used as default
39
+ #config.mailer_from = 'from@example.com'
@@ -30,7 +30,7 @@ module Contactus
30
30
  {
31
31
  :subject => I18n.t('.contactus.contact_forms.subject'),
32
32
  :to => Contactus.mailer_to,
33
- :from => %("#{name}" <#{email}>)
33
+ :from => from_email
34
34
  }
35
35
  end
36
36
 
@@ -38,6 +38,10 @@ module Contactus
38
38
  (Contactus.mailer_cc)? { :cc => Contactus.mailer_cc } : {}
39
39
  end
40
40
 
41
+ def from_email
42
+ Contactus.mailer_from || %("#{name}" <#{email}>)
43
+ end
44
+
41
45
  end
42
46
 
43
47
  end
@@ -2,6 +2,9 @@ require "contactus/engine"
2
2
 
3
3
  module Contactus
4
4
 
5
+ # From address email.
6
+ mattr_accessor :mailer_from
7
+
5
8
  # Address to send the email.
6
9
  mattr_accessor :mailer_to
7
10
 
@@ -1,3 +1,3 @@
1
1
  module Contactus
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -14,4 +14,7 @@ Contactus.setup do |config|
14
14
  # Configure extra required fields
15
15
  #config.required_extra_fields = %w(country address)
16
16
 
17
+ # From address email, if this variable is commented the contact email will be used as default
18
+ #config.mailer_from = 'from@example.com'
19
+
17
20
  end
@@ -7163,3 +7163,146 @@ Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.0ms)
7163
7163
   (0.1ms) rollback transaction
7164
7164
   (0.1ms) begin transaction
7165
7165
   (0.1ms) rollback transaction
7166
+  (0.5ms) begin transaction
7167
+  (0.1ms) rollback transaction
7168
+  (0.1ms) begin transaction
7169
+  (0.1ms) rollback transaction
7170
+  (0.1ms) begin transaction
7171
+  (0.1ms) rollback transaction
7172
+  (0.1ms) begin transaction
7173
+  (0.1ms) rollback transaction
7174
+  (0.1ms) begin transaction
7175
+  (0.1ms) rollback transaction
7176
+  (0.1ms) begin transaction
7177
+  (0.1ms) rollback transaction
7178
+  (0.1ms) begin transaction
7179
+  (0.1ms) rollback transaction
7180
+  (0.1ms) begin transaction
7181
+  (0.1ms) rollback transaction
7182
+  (0.2ms) begin transaction
7183
+  (0.1ms) rollback transaction
7184
+  (0.1ms) begin transaction
7185
+  (0.1ms) rollback transaction
7186
+  (0.3ms) begin transaction
7187
+  (0.1ms) rollback transaction
7188
+  (0.1ms) begin transaction
7189
+  (0.1ms) rollback transaction
7190
+  (0.1ms) begin transaction
7191
+  (0.1ms) rollback transaction
7192
+  (0.1ms) begin transaction
7193
+  (0.1ms) rollback transaction
7194
+  (0.1ms) begin transaction
7195
+  (0.1ms) rollback transaction
7196
+  (0.1ms) begin transaction
7197
+  (0.1ms) rollback transaction
7198
+  (0.2ms) begin transaction
7199
+  (0.1ms) rollback transaction
7200
+  (0.1ms) begin transaction
7201
+  (0.1ms) rollback transaction
7202
+  (0.1ms) begin transaction
7203
+  (0.1ms) rollback transaction
7204
+  (0.1ms) begin transaction
7205
+  (0.0ms) rollback transaction
7206
+  (1.5ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
7207
+  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
7208
+  (0.1ms) SELECT version FROM "schema_migrations"
7209
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
7210
+  (0.3ms) begin transaction
7211
+ Started GET "/contact" for 127.0.0.1 at 2013-10-21 11:12:05 -0500
7212
+ Processing by Contactus::ContactFormsController#new as HTML
7213
+ Rendered /Users/joselo/code/contactus/app/views/contactus/contact_forms/new.html.haml within layouts/application (574.1ms)
7214
+ Completed 200 OK in 652ms (Views: 651.1ms | ActiveRecord: 0.0ms)
7215
+ Started POST "/contactus/contact_forms" for 127.0.0.1 at 2013-10-21 11:12:06 -0500
7216
+ Processing by Contactus::ContactFormsController#create as HTML
7217
+ Parameters: {"utf8"=>"✓", "contactus_contact_form"=>{"name"=>"", "city"=>"", "email"=>"", "message"=>"", "nickname"=>""}, "commit"=>"Enviar"}
7218
+ Rendered /Users/joselo/code/contactus/app/views/contactus/contact_forms/new.html.haml within layouts/application (7.3ms)
7219
+ Completed 200 OK in 11ms (Views: 8.2ms | ActiveRecord: 0.0ms)
7220
+  (0.1ms) rollback transaction
7221
+  (0.1ms) begin transaction
7222
+ Started GET "/contact" for 127.0.0.1 at 2013-10-21 11:12:06 -0500
7223
+ Processing by Contactus::ContactFormsController#new as HTML
7224
+ Rendered /Users/joselo/code/contactus/app/views/contactus/contact_forms/new.html.haml within layouts/application (9.0ms)
7225
+ Completed 200 OK in 10ms (Views: 9.9ms | ActiveRecord: 0.0ms)
7226
+ Started POST "/contactus/contact_forms" for 127.0.0.1 at 2013-10-21 11:12:06 -0500
7227
+ Processing by Contactus::ContactFormsController#create as HTML
7228
+ Parameters: {"utf8"=>"✓", "contactus_contact_form"=>{"name"=>"Bill Hicks", "city"=>"", "email"=>"beelzebozo@example.com", "message"=>"If you think you’re free, try going somewhere without fucking money, okay?", "nickname"=>""}, "commit"=>"Enviar"}
7229
+ Rendered /Users/joselo/.rvm/gems/ruby-2.0.0-p195@contactus/gems/mail_form-1.5.0/lib/mail_form/views/mail_form/contact.erb (2.4ms)
7230
+
7231
+ Sent mail to webmaster@example.com (45.5ms)
7232
+ Date: Mon, 21 Oct 2013 11:12:07 -0500
7233
+ From: Bill Hicks <beelzebozo@example.com>
7234
+ To: webmaster@example.com
7235
+ Message-ID: <52655257826c9_97523fd7f945e6cc756f@Joses-MacBook-Pro.local.mail>
7236
+ Subject: Alguien se a puesto en contacto.
7237
+ Mime-Version: 1.0
7238
+ Content-Type: text/html;
7239
+ charset=UTF-8
7240
+ Content-Transfer-Encoding: quoted-printable
7241
+
7242
+ <h4 style=3D"text-decoration:underline">Alguien se a puesto en contacto.<=
7243
+ /h4>
7244
+
7245
+
7246
+ <p><b>Nombres y Apellidos:</b>
7247
+ Bill Hicks</p>
7248
+
7249
+ <p><b>Correo electr=C3=B3nico:</b>
7250
+ beelzebozo@example.com</p>
7251
+
7252
+ <p><b>Comentarios:</b>
7253
+ If you think you=E2=80=99re free, try going somewhere without fucking m=
7254
+ oney, okay?</p>
7255
+
7256
+ <br /><h4 style=3D"text-decoration:underline">Informaci=C3=B3n t=C3=A9c=
7257
+ nica sobre el usuario</h4>
7258
+
7259
+
7260
+ <p><b>Direcci=C3=B3n IP:</b>
7261
+ 127.0.0.1</p>
7262
+
7263
+ <p><b>Navegador:</b>
7264
+ nil</p>
7265
+
7266
+ <p><b>Session:</b>
7267
+ #&lt;ActionDispatch::Request::Session:0x7faff39d71a0 not yet loaded&g=
7268
+ t;</p>
7269
+ <br />
7270
+
7271
+ Rendered /Users/joselo/code/contactus/app/views/contactus/contact_forms/create.html.haml within layouts/application (2.9ms)
7272
+ Completed 200 OK in 1020ms (Views: 18.9ms | ActiveRecord: 0.0ms)
7273
+  (0.1ms) rollback transaction
7274
+  (0.1ms) begin transaction
7275
+ Started GET "/contact" for 127.0.0.1 at 2013-10-21 11:12:07 -0500
7276
+ Processing by Contactus::ContactFormsController#new as HTML
7277
+ Rendered /Users/joselo/code/contactus/app/views/contactus/contact_forms/new.html.haml within layouts/application (6.0ms)
7278
+ Completed 200 OK in 7ms (Views: 6.8ms | ActiveRecord: 0.0ms)
7279
+ Started POST "/contactus/contact_forms" for 127.0.0.1 at 2013-10-21 11:12:07 -0500
7280
+ Processing by Contactus::ContactFormsController#create as HTML
7281
+ Parameters: {"utf8"=>"✓", "contactus_contact_form"=>{"name"=>"Bill Hicks", "city"=>"", "email"=>"beelzebozo@example.com", "message"=>"If you think you’re free, try going somewhere without fucking money, okay?", "nickname"=>"Hey there"}, "commit"=>"Enviar"}
7282
+ Redirected to http://www.example.com/
7283
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
7284
+ Started GET "/" for 127.0.0.1 at 2013-10-21 11:12:07 -0500
7285
+ Processing by WelcomeController#index as HTML
7286
+ Rendered welcome/index.html.haml within layouts/application (0.7ms)
7287
+ Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.0ms)
7288
+  (0.1ms) rollback transaction
7289
+  (0.1ms) begin transaction
7290
+  (0.1ms) rollback transaction
7291
+  (0.1ms) begin transaction
7292
+  (0.1ms) rollback transaction
7293
+  (0.1ms) begin transaction
7294
+  (0.0ms) rollback transaction
7295
+  (0.1ms) begin transaction
7296
+  (0.0ms) rollback transaction
7297
+  (0.0ms) begin transaction
7298
+  (0.0ms) rollback transaction
7299
+  (0.1ms) begin transaction
7300
+  (0.0ms) rollback transaction
7301
+  (0.0ms) begin transaction
7302
+  (0.1ms) rollback transaction
7303
+  (0.1ms) begin transaction
7304
+  (0.1ms) rollback transaction
7305
+  (0.0ms) begin transaction
7306
+  (0.1ms) rollback transaction
7307
+  (0.1ms) begin transaction
7308
+  (0.1ms) rollback transaction
@@ -34,10 +34,11 @@ module Contactus
34
34
 
35
35
  end
36
36
 
37
- context 'with cc' do
37
+ context 'with custom variables' do
38
38
 
39
39
  before do
40
40
  Contactus.mailer_cc = "cc@example.com"
41
+ Contactus.mailer_from = "from@example.com"
41
42
  @contact_form = FactoryGirl.build(:contact_form)
42
43
  end
43
44
 
@@ -45,6 +46,10 @@ module Contactus
45
46
  @contact_form.headers[:cc].should == Contactus.mailer_cc
46
47
  end
47
48
 
49
+ it 'should assing the from' do
50
+ @contact_form.headers[:from].should == Contactus.mailer_from
51
+ end
52
+
48
53
  end
49
54
 
50
55
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contactus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Carrion
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-18 00:00:00.000000000 Z
11
+ date: 2013-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails