wco_email 0.1.1.109 → 0.1.1.110
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c170fe41b3f7c1c83478084a749938e85f2f7667fea798bb268e83f2b7335df6
|
|
4
|
+
data.tar.gz: 9f1fd7f6a14c211881e6b11d894b47a26551767b633e61b82154d0a2c7392f2e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1531fb06fa3c88edeb04fde54ade95d7a22ebb02bbcbfcc4eb75460b8d3d537ae188cef559108de5f9972ef4e28968432b713e3b030668a5b09363a7cb9d38cb
|
|
7
|
+
data.tar.gz: de5fbe83b6fb1f7271bb565e4b61b8f7d9bf0547aadbb9a8cba80012a460da1dbfbad5f3019416d62b87ac6c5730764d871a39463c22df7df116e027d21080dd
|
|
@@ -11,6 +11,7 @@ class WcoEmail::EmailCampaignsController < WcoEmail::ApplicationController
|
|
|
11
11
|
def create
|
|
12
12
|
@campaign = EmailCampaign.new params[:campaign].permit!
|
|
13
13
|
authorize! :create, @campaign
|
|
14
|
+
|
|
14
15
|
if @campaign.save
|
|
15
16
|
flash[:notice] = "created campaign"
|
|
16
17
|
else
|
|
@@ -23,6 +24,12 @@ class WcoEmail::EmailCampaignsController < WcoEmail::ApplicationController
|
|
|
23
24
|
@campaign = EmailCampaign.find params[:id]
|
|
24
25
|
authorize! :send, @campaign
|
|
25
26
|
@campaign.do_send
|
|
27
|
+
@campaign.update_attributes({
|
|
28
|
+
status: 'inactive',
|
|
29
|
+
sent_at: Time.now,
|
|
30
|
+
})
|
|
31
|
+
flash[:notice] = 'Probably ok.'
|
|
32
|
+
redirect_to request.referrer
|
|
26
33
|
end
|
|
27
34
|
|
|
28
35
|
def edit
|
|
@@ -38,6 +45,8 @@ class WcoEmail::EmailCampaignsController < WcoEmail::ApplicationController
|
|
|
38
45
|
def new
|
|
39
46
|
@campaign = EmailCampaign.new
|
|
40
47
|
authorize! :new, @campaign
|
|
48
|
+
|
|
49
|
+
@tags_list = Wco::Tag.list
|
|
41
50
|
end
|
|
42
51
|
|
|
43
52
|
def show
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
.email-campaigns--form
|
|
5
5
|
= form_for campaign, as: :campaign, url: url do |f|
|
|
6
6
|
.field
|
|
7
|
-
|
|
8
|
-
= f.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
-# = f.text_field :send_at
|
|
7
|
+
%label active_tag
|
|
8
|
+
= f.select :active_tag, options_for_select(@tags_list, selected: campaign.active_tag_id), {}, { class: 'select2' }
|
|
9
|
+
.field
|
|
10
|
+
%label inactive_tag
|
|
11
|
+
= f.select :inactive_tag, options_for_select(@tags_list, selected: campaign.active_tag_id), {}, { class: 'select2' }
|
|
13
12
|
|
|
14
13
|
.field.field-template
|
|
15
14
|
= f.label "Template"
|
|
@@ -19,15 +18,5 @@
|
|
|
19
18
|
= link_to '~', edit_email_template_path( campaign.email_template_id ), target: :_blank, class: [ 'action-view' ]
|
|
20
19
|
layout: #{campaign.tmpl.layout}
|
|
21
20
|
|
|
22
|
-
.field
|
|
23
|
-
= f.label "From"
|
|
24
|
-
= f.select :from_email, options_for_select(WcoEmail::EmailTemplate.from_emails_list, selected: campaign.from_email), {}, class: 'select2'
|
|
25
|
-
|
|
26
21
|
.actions
|
|
27
22
|
= f.submit 'Submit'
|
|
28
|
-
|
|
29
|
-
-# = f.select :email_template_id, options_for_select(@email_templates_list, selected: params[:email_template_id] || campaign.email_template_id ), {}, { class: 'select2' }
|
|
30
|
-
-# - if campaign.email_template_id
|
|
31
|
-
-# = link_to 'view', email_template_path( campaign.email_template_id ), target: :_blank, class: [ 'action-view' ]
|
|
32
|
-
-# = link_to '~', edit_email_template_path( campaign.email_template_id ), target: :_blank, class: [ 'action-view' ]
|
|
33
|
-
-# layout: #{campaign.tmpl.layout}
|
|
@@ -5,10 +5,23 @@
|
|
|
5
5
|
Email Campaigns (#{@campaigns.length})
|
|
6
6
|
= link_to '[+]', new_email_campaign_path
|
|
7
7
|
|
|
8
|
-
%
|
|
9
|
-
|
|
10
|
-
%
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
%table.bordered.padded
|
|
9
|
+
%thead
|
|
10
|
+
%tr
|
|
11
|
+
%th actions
|
|
12
|
+
%th active tag
|
|
13
|
+
%th inactive tag
|
|
14
|
+
%th tmpl
|
|
15
|
+
%th status
|
|
16
|
+
%th sent_at
|
|
17
|
+
%tbody
|
|
18
|
+
- @campaigns.each do |c|
|
|
19
|
+
%tr
|
|
20
|
+
%td
|
|
21
|
+
= button_to 'send', wco_email.send_email_campaign_path(c), :data => { :confirm => 'Are you sure?' }
|
|
22
|
+
%td= c.active_tag
|
|
23
|
+
%td= c.inactive_tag
|
|
24
|
+
%td= c.email_template
|
|
25
|
+
%td= c.status
|
|
26
|
+
%td= c.sent_at
|
|
14
27
|
|
data/config/routes.rb
CHANGED
|
@@ -32,6 +32,8 @@ WcoEmail::Engine.routes.draw do
|
|
|
32
32
|
post 'email_action_templates', to: 'email_action_templates#update'
|
|
33
33
|
resources :email_action_templates
|
|
34
34
|
resources :email_actions
|
|
35
|
+
|
|
36
|
+
post 'email_campaigns/:id/do_send', to: 'email_campaigns#do_send', as: :send_email_campaign
|
|
35
37
|
resources :email_campaigns
|
|
36
38
|
resources :email_layouts
|
|
37
39
|
|