Adding bulk email functionality
This commit is contained in:
parent
401ed3ddf4
commit
eca5238abd
5 changed files with 141 additions and 1 deletions
61
app/views/admin/emails/bulk.html.haml
Normal file
61
app/views/admin/emails/bulk.html.haml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
.row
|
||||
.col-md-8
|
||||
%h2 Bulk Email
|
||||
%p Send customized emails to registered users based on their registration status.
|
||||
|
||||
= form_tag send_bulk_admin_conference_emails_path(@conference.short_title), method: :post, class: 'form-horizontal' do
|
||||
.form-group
|
||||
= label_tag :subject, 'Subject', class: 'col-sm-2 control-label'
|
||||
.col-sm-10
|
||||
= text_field_tag :subject, params[:subject], class: 'form-control', required: true
|
||||
|
||||
.form-group
|
||||
= label_tag :body, 'Body', class: 'col-sm-2 control-label'
|
||||
.col-sm-10
|
||||
= text_area_tag :body, params[:body], rows: 10, class: 'form-control', required: true
|
||||
%p.help-block You can use the following variables in your email: {name}, {conference}, {registrationlink}
|
||||
|
||||
.form-group
|
||||
= label_tag :filter_type, 'Send to', class: 'col-sm-2 control-label'
|
||||
.col-sm-10
|
||||
= select_tag :filter_type, options_for_select([
|
||||
['All registered users', 'all_registered'],
|
||||
['Users who haven\'t answered any questions', 'no_questions_answered'],
|
||||
['Users who answered some but not all questions', 'some_questions_answered'],
|
||||
['Users who answered all questions', 'all_questions_answered']
|
||||
], params[:filter_type]), { class: 'form-control', required: true }
|
||||
|
||||
- if @questions.any?
|
||||
.form-group
|
||||
.col-sm-offset-2.col-sm-10
|
||||
%h4 Registration Questions
|
||||
%ul
|
||||
- @questions.each do |question|
|
||||
%li= question.title
|
||||
|
||||
.form-group
|
||||
.col-sm-offset-2.col-sm-10
|
||||
= submit_tag 'Send Bulk Email', class: 'btn btn-primary', data: { confirm: 'Are you sure you want to send this email to all selected recipients?' }
|
||||
= link_to 'Cancel', admin_conference_emails_path(@conference.short_title), class: 'btn btn-default'
|
||||
|
||||
.col-md-4
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h4 Recipient Preview
|
||||
.panel-body
|
||||
%p
|
||||
%strong All registered users:
|
||||
= @conference.registrations.count
|
||||
- if @questions.any?
|
||||
%p
|
||||
%strong No questions answered:
|
||||
= @registrations.select { |r| r.qanswers.empty? }.count
|
||||
%p
|
||||
%strong Some questions answered:
|
||||
= @registrations.select { |r| r.qanswers.any? && r.qanswers.count < @questions.count }.count
|
||||
%p
|
||||
%strong All questions answered:
|
||||
= @registrations.select { |r| r.qanswers.count >= @questions.count }.count
|
||||
- else
|
||||
%p
|
||||
%em No registration questions configured for this conference.
|
||||
|
|
@ -16,6 +16,8 @@
|
|||
%a{ 'aria-controls' => 'cfp', 'data-toggle' => 'tab', href: '#cfp', role: 'tab' } Call for Papers
|
||||
%li{ role: 'presentation' }
|
||||
%a{ 'aria-controls' => 'booths', 'data-toggle' => 'tab', href: '#booth', role: 'tab' } Booth
|
||||
%li{ role: 'presentation' }
|
||||
%a{ 'aria-controls' => 'bulk', 'data-toggle' => 'tab', href: '#bulk', role: 'tab' } Bulk Email
|
||||
/ Tab panes
|
||||
.tab-content
|
||||
#onboarding.tab-pane.active{ role: 'tabpanel' }
|
||||
|
|
@ -211,6 +213,17 @@
|
|||
'data-body-text' => "Dear {name},\n\nThank you for your #{t'booth'} request {booth_title} for the conference {conference}.\n\nUnfortunately, we are sorry to inform you that your request has been rejected.\n\n\nBest wishes\n\n{conference} Team" } Load Template
|
||||
%a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'booth_rejection_help' } Show help
|
||||
= render partial: 'help', locals: {id: 'booth_rejection_help', show_event_variables: false}
|
||||
#bulk.tab-pane{ role: 'tabpanel' }
|
||||
%p Send customized emails to registered users based on their registration status.
|
||||
.form-group
|
||||
= link_to 'Go to Bulk Email', bulk_admin_conference_emails_path(@conference.short_title), class: 'btn btn-success'
|
||||
%p
|
||||
%strong Available filters:
|
||||
%ul
|
||||
%li All registered users
|
||||
%li Users who haven't answered any registration questions
|
||||
%li Users who answered some but not all questions
|
||||
%li Users who answered all questions
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue