tkh_mailing_list 0.11.1.1 → 0.11.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: 1e3115122bf798f4241b05c7b39ad47495a7d095
|
4
|
+
data.tar.gz: 00d14feea202dabfa8ced3057df3add4a7e02813
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12003cb493773362c19028628d64eff126d1db7fac472c93158ea061146e2e72192223a3a16c0625411f9fa0e135dcd0abbf0fde468fd5dacbf46d66f5b99e1d
|
7
|
+
data.tar.gz: d464a8186529092245095bf2cb72035ba16eca8b3da346a85a5a8df7879b100cc9bb7a2070586917d3157d57fcebe2e7bdddd3ba1a8e2b56d2ff736bfade494d
|
@@ -3,9 +3,10 @@ class AdministrationMailer < ActionMailer::Base
|
|
3
3
|
|
4
4
|
default :from => "#{Setting.first.try(:company_name)} <#{Setting.first.try(:contact_email)}>"
|
5
5
|
|
6
|
-
def daily_digest( admin_user, yesterdays_contact_messages )
|
6
|
+
def daily_digest( admin_user, yesterdays_contact_messages, pending_comments )
|
7
7
|
@recipient = admin_user
|
8
8
|
@contact_messages = yesterdays_contact_messages
|
9
|
+
@pending_comments = pending_comments
|
9
10
|
# FIXME - only the email addresses show up. not the names :-(
|
10
11
|
recipient = "#{@recipient.name} <#{@recipient.email}>"
|
11
12
|
reply_to = "#{Setting.first.try(:company_name)} <#{Setting.first.try(:contact_email)}>"
|
@@ -3,7 +3,8 @@ class Administration < ActiveRecord::Base
|
|
3
3
|
def self.send_daily_digest
|
4
4
|
digest_is_needed = false
|
5
5
|
@yesterdays_contact_messages = Contact.yesterdays.chronologically
|
6
|
-
|
6
|
+
@pending_comments = Comment.pending.by_created
|
7
|
+
digest_is_needed = true if @yesterdays_contact_messages.count > 0 || @pending_comments.count > 0
|
7
8
|
if digest_is_needed
|
8
9
|
User.administrators.each do |administrator|
|
9
10
|
send_message_to_admin(administrator)
|
@@ -16,10 +17,10 @@ class Administration < ActiveRecord::Base
|
|
16
17
|
def self.send_message_to_admin(recipient)
|
17
18
|
# Actually send the email to the administrator
|
18
19
|
begin
|
19
|
-
AdministrationMailer.daily_digest( recipient, @yesterdays_contact_messages ).deliver_now
|
20
|
+
AdministrationMailer.daily_digest( recipient, @yesterdays_contact_messages, @pending_comments ).deliver_now
|
20
21
|
return 'success'
|
21
22
|
rescue Exception => e
|
22
|
-
AdminMailer.rescued_exceptions(e, "Some exception occurred while trying to send to site admin
|
23
|
+
AdminMailer.rescued_exceptions(e, "Some exception occurred while trying to send to site admin the daily digest.").deliver
|
23
24
|
@exception = e
|
24
25
|
return 'exception'
|
25
26
|
end
|
@@ -2,14 +2,24 @@
|
|
2
2
|
|
3
3
|
<p>This a summary of what happened yesterday on the <%= Setting.first.try(:site_name) %> website.</p>
|
4
4
|
|
5
|
-
|
5
|
+
<% unless @pending_comments.blank? %>
|
6
|
+
<h2><%= t 'comments.digest_intro' %></h2>
|
7
|
+
<ul>
|
8
|
+
<% @pending_comments.each do |comment| %>
|
9
|
+
<li><%= "from #{comment.author.name}: #{truncate(strip_tags(comment.body), length: 50)}" %></li>
|
10
|
+
<% end %>
|
11
|
+
</ul>
|
12
|
+
<p>You can see and manage these comments at: <%= link_to 'pending comments', pending_comments_url %>.</p>
|
13
|
+
<% end %>
|
6
14
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
15
|
+
<% unless @contact_messages.blank? %>
|
16
|
+
<h2>List of messages from the contact form:</h2>
|
17
|
+
<ul>
|
18
|
+
<% @contact_messages.each do |message| %>
|
19
|
+
<li><%= "from #{message.sender_name} (#{message.sender_email}): #{truncate(strip_tags(message.body), length: 50)}" %></li>
|
20
|
+
<% end %>
|
21
|
+
</ul>
|
22
|
+
<p>You can see and manage these messages at: <%= link_to 'contact messages', contacts_url %>.</p>
|
23
|
+
<% end %>
|
14
24
|
|
15
25
|
<p>You are receiving this email because you are an administrator of the <%= Setting.first.try(:site_name) %> website.</p>
|
@@ -1,7 +1,16 @@
|
|
1
1
|
Hi <%= @recipient.friendly_name %>,
|
2
2
|
|
3
3
|
This a summary of what happened yesterday on the <%= Setting.first.try(:site_name) %> website.
|
4
|
+
<% unless @pending_comments.blank? %>
|
5
|
+
<%= t 'comments.digest_intro' %>
|
4
6
|
|
7
|
+
<% @pending_comments.each do |comment| %>
|
8
|
+
<%= "- from #{comment.author.name}: #{truncate comment.body, length: 50}" %>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
You can see and manage these comments at: <%= pending_comments_url %>
|
12
|
+
<% end %>
|
13
|
+
<% unless @contact_messages.blank? %>
|
5
14
|
List of messages from the contact form:
|
6
15
|
|
7
16
|
<% @contact_messages.each do |message| %>
|
@@ -9,5 +18,6 @@ List of messages from the contact form:
|
|
9
18
|
<% end %>
|
10
19
|
|
11
20
|
You can see and manage these messages at: <%= contacts_url %>
|
21
|
+
<% end %>
|
12
22
|
|
13
23
|
You are receiving this email because you are an administrator of the <%= Setting.first.try(:site_name) %> website.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tkh_mailing_list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Swami Atma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|