spina_contact_forms 0.1.01 → 0.1.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 271059450a3277a6d1854e61b063face82479e5f
|
4
|
+
data.tar.gz: c931c3c6b968bb44bc2e65d211f545bd2e979522
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaddf19354d3b2449f4d35458ddc9504de6fa49e2765a9c24a6accd33c93727060a5eb8e75530eb8661887b83e537d763806c4e449391b646e756f4c481df2cb
|
7
|
+
data.tar.gz: a15a718033f06f5a8add9a45bba5f4cbd0d30b1891741870fa92a2538d5d73b1d11182496810907899d3e328a05e5c5c1fc36731f51a1510cf4eb21704bd033c
|
data/README.md
CHANGED
@@ -25,6 +25,9 @@ Add the following to `config/secrets.yml`
|
|
25
25
|
contact_form_from_email: contact_form@yourdomain.com
|
26
26
|
```
|
27
27
|
|
28
|
+
The email will be sent to whatever current_account.email returns, so make sure an email address is saved in the database under account settings.
|
29
|
+
|
30
|
+
|
28
31
|
Add the following to your theme's config file (config/initializers/themes/theme_name.rb)
|
29
32
|
```ruby
|
30
33
|
theme.plugins = ['ContactForm']
|
@@ -3,7 +3,7 @@ module Spina
|
|
3
3
|
|
4
4
|
def create
|
5
5
|
@email_content = params.permit!.except(:utf8, :controller, :action)
|
6
|
-
Spina::ContactFormMailer.send_form(@email_content).deliver_now
|
6
|
+
Spina::ContactFormMailer.send_form(@email_content, current_account.email).deliver_now
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module Spina
|
2
2
|
class ContactFormMailer < ActionMailer::Base
|
3
|
-
default from: Rails.application.secrets
|
3
|
+
default from: Rails.application.secrets.contact_form_from_email
|
4
4
|
layout 'mailers/spina_contact_form'
|
5
5
|
|
6
|
-
def send_form(email_content)
|
6
|
+
def send_form(email_content, email_address)
|
7
7
|
@email_content = email_content
|
8
|
-
mail(to:
|
8
|
+
mail(to: email_address, subject: 'From your Contact Form')
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
$('#spina_contact_form').find("input[type=text], textarea").val("");
|