effective_events 2.26.0 → 2.28.0

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
  SHA256:
3
- metadata.gz: 93702d0f34b53536a8534ad5d983be17e75f66bf133e8cd67c46e3d38f6ec5dc
4
- data.tar.gz: 243eb4b9796e5b0752ec0bfa4d121508253550e5765a62be4252e2835a6391d8
3
+ metadata.gz: 2a2da9770f5c4f1594f4364d6ac060476cdd4e4624c8c1e8866c4ce096001ba6
4
+ data.tar.gz: 94af1b7beb1e82aa64fce228e047dfbca828bf5fddc1e88ffb7d59b1e94a0833
5
5
  SHA512:
6
- metadata.gz: 408c0a3b0d923e692e1c853945e0b2899e83d02743049cc7d834ccb1163f00ca6e941b5291e9ece8abe98177f4d475b99eeaa15c9d3f047aa153f0e0f94cfc15
7
- data.tar.gz: d1d0ddeb5f16cfd4d803e76222b27c5450f584f45adc9f63961fe7f0c033490554f1ab2780d964fcea91113d8553ce1e53d55c4de5afc744e0dddd5075b5f178
6
+ metadata.gz: ac0da1b17544723dbf542c7286fa456991b0882baf0c5bb0aefe5ef3d4f3cd18aecef8741a984761ffc33f54c50930d3a90dfbe398aefcca97baf3332abdf12d
7
+ data.tar.gz: 6a194263574e2a7b715573f39a94fc06c9e653100b80f98f1e123a7a034ebf21fb9549f140a266501e28aaf3a1634515a3ad79afff752eb2a6a8dd1902d4f85b
@@ -24,10 +24,11 @@ module Effective
24
24
 
25
25
  @event_registration = resource
26
26
  @event = resource.event
27
- @event_registrants = resource.event_registrants
28
- @event_addons = resource.event_addons
29
27
 
30
- subject = subject_for(__method__, "Event Confirmation - #{@event}", resource, opts)
28
+ @order = @event_registration.submit_order
29
+ raise('expected an event registration submit_order') unless @order.present?
30
+
31
+ subject = subject_for(__method__, "Confirmation - #{@event}", resource, opts)
31
32
  headers = headers_for(resource, opts)
32
33
 
33
34
  mail(to: resource.owner.email, subject: subject, **headers)
@@ -41,7 +42,7 @@ module Effective
41
42
  @event = resource.event
42
43
  @event_registration = resource.event_registration # Optional
43
44
 
44
- subject = subject_for(__method__, "Event Registrant Confirmation - #{@event}", resource, opts)
45
+ subject = subject_for(__method__, "Confirmation - #{@event}", resource, opts)
45
46
  headers = headers_for(resource, opts)
46
47
 
47
48
  mail(to: resource.email, subject: subject, **headers)
@@ -229,7 +229,7 @@ module EffectiveEventsEventRegistration
229
229
  notifications = event.event_notifications.select(&:registrant_purchased?)
230
230
  notifications.each { |notification| notification.notify!(event_registrants: event_registrants) }
231
231
 
232
- send_event_registration_confirmation! unless submit_order&.delayed?
232
+ send_event_registration_confirmation! unless submit_order&.delayed? || submit_order&.deferred?
233
233
  end
234
234
  end
235
235
 
@@ -488,6 +488,8 @@ module EffectiveEventsEventRegistration
488
488
  # Sent on delayed payment date registration update
489
489
  # Sent on update blank registrants
490
490
  def send_event_registration_confirmation!
491
+ return false unless EffectiveEvents.send_confirmation_email?
492
+
491
493
  EffectiveEvents.send_email(:event_registration_confirmation, self)
492
494
  end
493
495
 
@@ -1,22 +1,39 @@
1
- %h2 Event Registrant Confirmation
1
+ %h1{style: "text-align: center"} Your tickets have been confirmed!
2
2
 
3
- %p Event: #{@event.title}
4
- %p Date: #{effective_events_event_schedule(@event)}
5
- %p Ticket: #{@event_registrant.purchasable_name.gsub('<br>', ' - ').html_safe} - #{price_to_currency(@event_registrant.price)}
6
-
7
- - if @event_registrant.responses.present?
8
- %p= @event_registrant.responses
9
-
10
- - if @event_registration.present? && @event_registrant.user == @event_registration.owner
11
- %p= link_to('View your registration', effective_events.event_event_registration_url(@event, @event_registration))
3
+ %p{style: "text-align: center"}
4
+ %strong{style: "font-size: 18px"}= @event.title
5
+ %br
6
+ #{effective_events_event_schedule(@event)}
12
7
 
13
8
  - if @event.rich_text_confirmation_email.present?
14
9
  %hr
15
10
  = @event.rich_text_confirmation_email.to_s.html_safe
16
11
 
17
- - if @event.delayed_payment?
18
- %strong Please note:
19
- %ul
20
- %li Credit card payment will be processed on #{@event.delayed_payment_date.strftime("%A, %B %d, %Y")}
12
+ - if @event.delayed_payment? && @event_registration.present? && @event_registrant.user == @event_registration.owner && @event_registration.submit_order.delayed? && @event_registration.submit_order.deferred?
13
+ %hr
14
+ %p{style: "margin-bottom: 4px; font-weight: bold;"} Please note:
15
+ %ul{style: "margin-top: 0;"}
16
+ %li Your credit card will be charged on <strong>#{@event.delayed_payment_date.strftime("%A, %B %d, %Y")}</strong>.
21
17
  %li Changes and cancellations must be made before this date.
22
- %li A receipt will be sent to you after the transaction is completed.
18
+ %li A receipt will be sent after the transaction is completed.
19
+
20
+ %hr
21
+
22
+ %table.table
23
+ %thead
24
+ %tr
25
+ %th{style: "text-align: left;"} Qty
26
+ %th{style: "text-align: left;"} Ticket
27
+ %th{style: "text-align: right;"} Price
28
+ %tbody
29
+ %tr
30
+ %td{style: "text-align: left;"} 1
31
+ %td{style: "text-align: left;"}
32
+ = @event_registrant.purchasable_name
33
+ = @event_registrant.responses if @event_registrant.responses.present?
34
+ %td{style: "text-align: right;"}= price_to_currency(@event_registrant.price)
35
+
36
+ - if @event_registration.present? && @event_registrant.user == @event_registration.owner
37
+ %hr
38
+ %p{style: "text-align: center;"}
39
+ = link_to('View your registration', effective_events.event_event_registration_url(@event, @event_registration))
@@ -1,45 +1,101 @@
1
- %h2 Event Registration Confirmation
1
+ %h1{style: "text-align: center"} Your tickets have been confirmed!
2
2
 
3
- %p Event: #{@event.title}
4
- %p Date: #{effective_events_event_schedule(@event)}
5
- %p= link_to('View your registration', effective_events.event_event_registration_url(@event, @event_registration))
3
+ %p{style: "text-align: center"}
4
+ %strong{style: "font-size: 18px"}= @event.title
5
+ %br
6
+ #{effective_events_event_schedule(@event)}
6
7
 
7
8
  - if @event.rich_text_confirmation_email.present?
8
9
  %hr
9
10
  = @event.rich_text_confirmation_email.to_s.html_safe
10
11
 
11
12
  - if @event.delayed_payment?
12
- %strong Please note:
13
- %ul
14
- %li Credit card payment will be processed on #{@event.delayed_payment_date.strftime("%A, %B %d, %Y")}
13
+ %hr
14
+ %p{style: "margin-bottom: 4px; font-weight: bold;"} Please note:
15
+ %ul{style: "margin-top: 0;"}
16
+ %li Your credit card will be charged on <strong>#{@event.delayed_payment_date.strftime("%A, %B %d, %Y")}</strong>.
15
17
  %li Changes and cancellations must be made before this date.
16
- %li A receipt will be sent to you after the transaction is completed.
18
+ %li A receipt will be sent after the transaction is completed.
17
19
 
18
20
  %hr
19
21
 
20
- - responses = Array(@event_registrants).any? { |er| er.responses.present? }
21
-
22
- %table.table
23
- %thead
24
- %tr
25
- %th Qty
26
- %th Ticket
27
- - if responses
28
- %th Details
29
- %th Price
30
- %tbody
31
- - Array(@event_registrants).each do |er|
22
+ .effective-order
23
+ %table.table{style: "margin-bottom: 20px;"}
24
+ %thead
32
25
  %tr
33
- %td 1
34
- %td= er.purchasable_name
35
- - if responses
36
- %td= er.responses
37
- %td= price_to_currency(er.price)
26
+ %th{style: "text-align: left;"} Qty
27
+ %th{style: "text-align: left;"} Ticket
28
+ %th{style: "text-align: right;"} Price
29
+
30
+ %tbody
31
+ - @order.order_items.each do |oi|
32
+ %tr
33
+ %td{style: "text-align: left;"}= oi.quantity
34
+ %td{style: "text-align: left;"}
35
+ = oi.to_s.html_safe
36
+ = oi.purchasable.try(:responses) || oi.purchasable.try(:notes)
37
+ %td.price= price_to_currency(oi.price)
38
38
 
39
- - Array(@event_addons).each do |ea|
39
+ %tfoot
40
40
  %tr
41
- %td 1
42
- %td= ea.purchasable_name
43
- - if responses
44
- %td= ea.notes
45
- %td= price_to_currency(ea.price)
41
+ %td{colspan: 3}= "&nbsp;".html_safe
42
+ %tr
43
+ %th.subtotal{colspan: 2}
44
+ Subtotal
45
+ %td.price.subtotal-price
46
+ = price_to_currency(@order.subtotal)
47
+
48
+ - if @order.tax_rate.blank?
49
+ -# Nothing to do. We can't display Tax, Total or Credit Card Surcharge (which is taxed) yet.
50
+
51
+ - elsif @order.tax_rate.present? && @order.surcharge_percent.to_f > 0.0
52
+ %tr
53
+ %th.tax{colspan: 2}
54
+ Tax (#{rate_to_percentage(@order.tax_rate)})
55
+ %td.price.tax-price
56
+ = price_to_currency(@order.tax)
57
+
58
+ %tr
59
+ %th.amount-owing{colspan: 2}
60
+ Amount owing before Credit Card Processing Fee
61
+ %td.price.amount-owing-price
62
+ = price_to_currency(@order.amount_owing)
63
+
64
+ %tr
65
+ %th.surcharge{colspan: 2}
66
+ Credit Card Processing Fee (#{rate_to_percentage(@order.surcharge_percent)}) on #{price_to_currency(@order.amount_owing)}
67
+ %td.price.surcharge-price
68
+ = price_to_currency(@order.surcharge)
69
+
70
+ %tr
71
+ %th.surcharge-tax{colspan: 2}
72
+ Tax (#{rate_to_percentage(@order.tax_rate)}) on Credit Card Processing Fee
73
+ %td.price.surcharge-tax-price
74
+ = price_to_currency(@order.surcharge_tax)
75
+
76
+ %tr
77
+ %th.total{colspan: 2}
78
+ Total amount charged to credit card
79
+ %td.price.total-price
80
+ = price_to_currency(@order.total)
81
+
82
+ - elsif @order.tax_rate.present? && !(@order.surcharge_percent.to_f > 0.0)
83
+ %tr
84
+ %th.tax{colspan: 2}
85
+ Tax (#{rate_to_percentage(@order.tax_rate)})
86
+ %td.price.tax-price
87
+ = price_to_currency(@order.tax)
88
+
89
+ %tr
90
+ %th.total{colspan: 2}
91
+ Total
92
+ %td.total-price
93
+ = price_to_currency(@order.total)
94
+
95
+ %hr
96
+
97
+ %p{style: "text-align: center;"}
98
+ - if @event.delayed_payment? && @order.delayed? && @order.deferred?
99
+ = link_to('View or modify your registration', effective_events.event_event_registration_url(@event, @event_registration))
100
+ - else
101
+ = link_to('View your registration', effective_events.event_event_registration_url(@event, @event_registration))
@@ -29,6 +29,9 @@ EffectiveEvents.setup do |config|
29
29
  # Hint text for event images attachments
30
30
  config.events_hint_text = 'Optional. Shown on the events index and event pages. Dimensions are 220px tall and 350px wide.'
31
31
 
32
+ # Send confirmation emails
33
+ config.send_confirmation_email = false
34
+
32
35
  # Mailer Settings
33
36
  # Please see config/initializers/effective_resources.rb for default effective_* gem mailer settings
34
37
  #
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '2.26.0'.freeze
2
+ VERSION = '2.28.0'.freeze
3
3
  end
@@ -9,7 +9,7 @@ module EffectiveEvents
9
9
  :events_table_name, :event_registrants_table_name, :event_tickets_table_name, :event_ticket_selections_table_name,
10
10
  :event_registrations_table_name, :event_products_table_name, :event_addons_table_name, :event_notifications_table_name,
11
11
  :mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_admin, :mailer_subject,
12
- :layout, :per_page, :use_effective_roles, :categories, :events_hint_text,
12
+ :layout, :per_page, :use_effective_roles, :categories, :events_hint_text, :send_confirmation_email,
13
13
  :organization_enabled, :create_users, :company_or_organization_required,
14
14
  :event_registration_class_name
15
15
  ]
@@ -39,4 +39,8 @@ module EffectiveEvents
39
39
  !!EffectiveOrders.try(:delayed?)
40
40
  end
41
41
 
42
+ def self.send_confirmation_email?
43
+ send_confirmation_email == true
44
+ end
45
+
42
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_events
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.26.0
4
+ version: 2.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-17 00:00:00.000000000 Z
11
+ date: 2024-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails