ecm_contact2 2.0.0 → 2.1.0

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: dbf4d3c03f8d9a8a628f7d1012859df59db32fd2
4
- data.tar.gz: 4fb86a3cf6cac2af75b278f1001ba1b3921ebd92
3
+ metadata.gz: e2bc6141f875323068c8eedcc9bc8a0337aa9c32
4
+ data.tar.gz: 86a7d71d1b2e3841b0220a878b8d3a8d60b1e451
5
5
  SHA512:
6
- metadata.gz: 80334f65c183a690bb4be09be1ee00fd608508bdf57e717ac07c374386eab92fc93a5118de1ee4b07d163eaea3365ece66fa3f504986acc8e12dc2ed275d0888
7
- data.tar.gz: be9688352831f45a3628b7c5999fac53ba775be0904a602c816e2f4729f031ae0555dbefb466580f85f08d0ddd9d9ca34ef1ae1811a97d6969e079ff6f8e35e8
6
+ metadata.gz: befcdf5b74400f95a4b5dcc996a09ab85b49c899d880aad5835ce1dd6e839ac5a456ee3a49159c79659fc76b2b3ee324688722ff13606cdae136038c069d96b8
7
+ data.tar.gz: ccc73ed805bbffcfb0286028fdf5db239795a64f1ce10b550552224ca88d3fcc7747ce77aa01e0c4d2b732eb6ae047e9e8bc0d1462b127d06b7437a094564c3a
@@ -20,7 +20,8 @@ module Ecm
20
20
  subject: proc { I18n.t('ecm.contact.request.subject', application_name: Rails.application.class.to_s.split('::').first) }.call,
21
21
  # :to => I18n.t('ecm.contact.request.recipients'),
22
22
  to: Ecm::Contact::Configuration.recipients[Rails.env],
23
- from: %("#{name}" <#{email}>)
23
+ # from: %("#{name}" <#{email}>)
24
+ from: Ecm::Contact::Configuration.sender.call(self)
24
25
  }
25
26
  end
26
27
  end
@@ -36,6 +36,10 @@ module Ecm
36
36
  {}
37
37
  end
38
38
 
39
+ mattr_accessor :sender do
40
+ ->(mail_form) { %("#{mail_form.name}" <#{mail_form.email}>) }
41
+ end
42
+
39
43
  mattr_accessor :base_controller do
40
44
  'ApplicationController'
41
45
  end
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Contact
3
- VERSION = '2.0.0'.freeze
3
+ VERSION = '2.1.0'.freeze
4
4
  end
5
5
  end
@@ -74,4 +74,10 @@ Ecm::Contact.configure do |config|
74
74
  # default: config.after_create_url = ->(controller) { controller.url_for(action: index) }
75
75
  #
76
76
  config.after_create_url = ->(controller) { controller.url_for(action: index) }
77
+
78
+ # Set the sender address.
79
+ #
80
+ # default: config.sender = ->(mail_form) { %("#{mail_form.name}" <#{mail_form.email}>) }
81
+ #
82
+ config.sender = ->(mail_form) { %("#{mail_form.name}" <#{mail_form.email}>) }
77
83
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_contact2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-01 00:00:00.000000000 Z
11
+ date: 2016-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails