azimuth_spree_easy_contact 1.0.3 → 1.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/README.md +5 -2
- data/app/controllers/admin/contacts_controller.rb +1 -2
- data/app/mailer/contact_mailer.rb +9 -1
- metadata +7 -7
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
SpreeEasyContact
|
2
2
|
================
|
3
3
|
|
4
|
-
Easy to implement contact form with
|
4
|
+
Easy to implement contact form with recaptcha, with a topic selection management in admin.
|
5
5
|
It stores all messages in DB for an easy recall of messages.
|
6
6
|
|
7
7
|
This extension is based on joshnuss spree-contact-form (thank you BTW) : https://github.com/joshnuss/spree-contact-form
|
@@ -11,7 +11,7 @@ Installation
|
|
11
11
|
|
12
12
|
Put the following line into your gemfile :
|
13
13
|
|
14
|
-
gem 'spree_easy_contact'
|
14
|
+
gem 'azimuth_spree_easy_contact', '= 1.0.3', :require => 'spree_easy_contact'
|
15
15
|
|
16
16
|
Then run all the following command :
|
17
17
|
|
@@ -23,6 +23,9 @@ rake db:migrate
|
|
23
23
|
|
24
24
|
Set properly the mail method in the admin area (/admin/mail_methods)
|
25
25
|
|
26
|
+
Configure your auto responder settings in Configuration / General Settings
|
27
|
+
Add Topics in Configuration / Contact Form Topic
|
28
|
+
|
26
29
|
Add the following to your application initializers:
|
27
30
|
|
28
31
|
Spree::Config.set(:recaptcha_public_key => '[your_recaptcha_public_key]')
|
@@ -7,8 +7,7 @@ class Admin::ContactsController < Admin::BaseController
|
|
7
7
|
@contact.email = current_user.email
|
8
8
|
respond_to do |format|
|
9
9
|
if @contact.valid? && @contact.save
|
10
|
-
ContactMailer.
|
11
|
-
ContactMailer.message_received_email(@contact).deliver
|
10
|
+
ContactMailer.response_email(@contact).deliver
|
12
11
|
flash[:notice] = t("message_sent")
|
13
12
|
format.html { redirect_to("/admin/conversations/#{@contact.conversation.id}") }
|
14
13
|
else
|
@@ -11,6 +11,14 @@ class ContactMailer < ActionMailer::Base
|
|
11
11
|
|
12
12
|
# Mails a message to the customer, acknowledging the contact
|
13
13
|
def message_received_email(message)
|
14
|
-
mail(:to => message.email, :subject => Spree::Config[:auto_response_email_subject], :reply_to => Spree::Config[:auto_response_email_reply_to])
|
14
|
+
mail(:to => message.conversation.contacts.first.email, :subject => Spree::Config[:auto_response_email_subject], :reply_to => Spree::Config[:auto_response_email_reply_to])
|
15
|
+
end
|
16
|
+
|
17
|
+
# Mails a response to the customer
|
18
|
+
def response_email(message)
|
19
|
+
subject = "#{Spree::Config[:site_name]} - #{t("#{message.conversation.topic}")}"
|
20
|
+
|
21
|
+
@message = message
|
22
|
+
mail(:to => message.conversation.contacts.first.email, :subject => subject, :reply_to => Spree::Config[:auto_response_email_reply_to])
|
15
23
|
end
|
16
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: azimuth_spree_easy_contact
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,11 +11,11 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2011-02-08 00:00:00.
|
14
|
+
date: 2011-02-08 00:00:00.000000000Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: spree_core
|
18
|
-
requirement: &
|
18
|
+
requirement: &2165183000 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
@@ -23,10 +23,10 @@ dependencies:
|
|
23
23
|
version: 0.40.0
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *2165183000
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: recaptcha
|
29
|
-
requirement: &
|
29
|
+
requirement: &2165182580 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ! '>='
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
version: '0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *2165182580
|
38
38
|
description:
|
39
39
|
email: contact@organicweb.fr
|
40
40
|
executables: []
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
108
108
|
- none
|
109
109
|
rubyforge_project:
|
110
|
-
rubygems_version: 1.8.
|
110
|
+
rubygems_version: 1.8.10
|
111
111
|
signing_key:
|
112
112
|
specification_version: 3
|
113
113
|
summary: Add gem summary here
|