cmor_contact 0.0.42.pre → 0.0.43.pre

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
  SHA256:
3
- metadata.gz: da66b6e67a0b194200dab05d23b1cb4a0cee7ac62d0250e4436ace8b5ee4649c
4
- data.tar.gz: 914c942f6a50d50bc4214821b1aee9b6ae2d25d49709d61507b6378e385182f7
3
+ metadata.gz: 92713d31b219505dfa10d3be2d920a2a22ad8f745b3941a83010e3963e76fe92
4
+ data.tar.gz: '09d2419e62ad3627eed16bcd4c547dd18a3e2402448e2a6bf8ca8111e863b544'
5
5
  SHA512:
6
- metadata.gz: 0e8f23681f08c621599b6fbb42b3fa53612952cb5a9b7c851459833dc9b165040a6fbed83085e7d9de4cfb856da32bd14ce65225ac069e50aa189fda2cf96717
7
- data.tar.gz: 51c1bc2915861388112d783e37f3ce8a24c837dfff4066008b6232fec68a0350b3aa64c4ec1dad3740e456de4cdce4b7fe3571b6c660295ad5328a82e3c21a9f
6
+ metadata.gz: 5852ce182a8df6f8b55969b76dc466c3e196839a7744ee689e17a4e6b03af606aef52d25c0c6bbd7e90213ffa642ab0fda092bcf3681e54206436ba21ae50257
7
+ data.tar.gz: ab490158c3976162598640151b3a60e87befef60c79ade39e57b06ee817f1b5b9bdbe5d78f0df163f0df7fcd6174f3315ce270f1392126678d93b6c70e9c661f
@@ -21,7 +21,8 @@ module Cmor::Contact
21
21
  end
22
22
 
23
23
  def notification_sender(contact_request)
24
- "#{contact_request.name} <#{contact_request.email}>"
24
+ Cmor::Contact::Configuration.sender.call(contact_request)
25
+ # "#{contact_request.name} <#{contact_request.email}>"
25
26
  end
26
27
 
27
28
  def notification_recipients
@@ -32,6 +32,10 @@ module Cmor
32
32
  'controls form-actions well'
33
33
  end
34
34
 
35
+ mattr_accessor :sender do
36
+ ->(contact_request) { "#{contact_request.name} <#{contact_request.email}>" }
37
+ end
38
+
35
39
  mattr_accessor :recipients do
36
40
  ->(environment) { "jane.doe@domain.local" }
37
41
  end
@@ -21,6 +21,28 @@ Cmor::Contact.configure do |config|
21
21
  }.with_indifferent_access[environment.to_sym]
22
22
  end
23
23
 
24
+ # Configure your contact request sender here.
25
+ #
26
+ # Default:
27
+ #
28
+ # config.sender = lambda do |contact_request|
29
+ # "#{contact_request.name} <#{contact_request.email}>"
30
+ # end
31
+ #
32
+ # You may want to reconfigure this to use a static email address from
33
+ # your domain to avoid being marked as spammer when contact requests
34
+ # are sent from invalid addresses.
35
+ #
36
+ # Example:
37
+ #
38
+ # config.sender = lambda do |contact_request|
39
+ # "My Application <contact@example.com>"
40
+ # end
41
+ #
42
+ config.sender = lambda do |contact_request|
43
+ "#{contact_request.name} <#{contact_request.email}>"
44
+ end
45
+
24
46
  # Configure your input field css classes here.
25
47
  #
26
48
  # Default: config.input_name_css_classes = 'form-control'