spree_cm_commissioner 2.1.5.pre.pre5 → 2.1.5.pre.pre6

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: 99decf18e47529cc2337fd45f441d43b25a0d3b6aaba5091fe9752a30157124b
4
- data.tar.gz: 2fccd2c15b025274b88449230ecc5fcf09df4e74318fc9e55f5694a27cc0875f
3
+ metadata.gz: 1ab577d7a9f4bf29317bcb5a728b534a64b448549006f0f76a6660ddab478610
4
+ data.tar.gz: 3b9135257e4516239e568a72028aabfe0271c1f53d49b277671cab5152f92ebe
5
5
  SHA512:
6
- metadata.gz: 834c04128ffb3283a940a31abd872aace701dce1095e012a18c4e95e9c20cef5ba16b5d66f3c58e1602fcd48e4a8fd28dd165575d6086fee4c491038e6b7f3fe
7
- data.tar.gz: e53900163f149bed4de754abaccdac238ab1a3f08e442961f72bf2f4a4248d412ad2fbb3ea7a91b0c8b264d9d200e91de6c5b7b39d3885ed392a47c863c46ab6
6
+ metadata.gz: cc482abcfd98cbb4309406e3db71a86f2f65ce3a382288760d8c5727296712d273fa61a7ca3342c969c2d3ab210b5d5feadc5960eca7a48e6e146b834ef6129a
7
+ data.tar.gz: 21b8ed8983b465cfd9c2a08e14477b085307bfa19b5bef3b2dc2c716f89b31fecc5be818744ae3c4a0aacfe9a69e68b41bdc7e9cd3839b1b0d04bef4048d2add
data/Gemfile.lock CHANGED
@@ -34,7 +34,7 @@ GIT
34
34
  PATH
35
35
  remote: .
36
36
  specs:
37
- spree_cm_commissioner (2.1.5.pre.pre5)
37
+ spree_cm_commissioner (2.1.5.pre.pre6)
38
38
  activerecord-multi-tenant
39
39
  activerecord_json_validator (~> 2.1, >= 2.1.3)
40
40
  aws-sdk-cloudfront
@@ -2,17 +2,26 @@ module SpreeCmCommissioner
2
2
  class GuestMailer < Spree::BaseMailer
3
3
  layout 'spree_cm_commissioner/layouts/guest_mailer'
4
4
 
5
- def send_ticket_to_guest(guest_id, email)
6
- @guest = SpreeCmCommissioner::Guest.find_by(id: guest_id)
5
+ def send_ticket_to_guest(guest, email)
6
+ @guest = guest
7
7
  @line_item = @guest.line_item
8
8
  @order = @line_item.order
9
9
  @product_type = @line_item.product_type || 'transit'
10
10
  @trip = SpreeCmCommissioner::Trip.find_by(id: @line_item.trip_id) if @line_item.trip_id.present?
11
11
  @email = email
12
12
  @current_store = @order.store
13
+ @guest_qr_data = @guest&.token
14
+ @logo_src = logo_src(@guest)
15
+ @store = @order.store
16
+ @vendor = @trip.vendor if @trip.present?
13
17
  subject = "#{@current_store&.name} Booking Confirmation ##{@order.number}"
14
-
15
18
  mail(from: from_address, to: @email, subject: subject)
16
19
  end
20
+
21
+ private
22
+
23
+ def logo_src(guest)
24
+ cdn_image_url(guest&.line_item&.vendor&.logo&.attachment || guest&.line_item&.order&.store&.logo&.attachment)
25
+ end
17
26
  end
18
27
  end
@@ -1,6 +1,5 @@
1
1
  module SpreeCmCommissioner
2
2
  class CustomerNotification < SpreeCmCommissioner::Base
3
- acts_as_paranoid column: :deleted_at
4
3
  has_many :notifications, as: :notificable, dependent: :destroy, class_name: 'SpreeCmCommissioner::Notification'
5
4
 
6
5
  # deprecated
@@ -33,7 +32,7 @@ module SpreeCmCommissioner
33
32
  end
34
33
 
35
34
  def self.scheduled_items
36
- where(['sent_at IS NULL AND started_at <= ?', Time.current])
35
+ where(['sent_at IS NULL AND started_at <= ? AND active', Time.current])
37
36
  end
38
37
  end
39
38
  end
@@ -0,0 +1,67 @@
1
+ <!-- Footer -->
2
+
3
+ <tr class="content-cell">
4
+ <td class="container">
5
+ <div class="section-divider"></div>
6
+ <h2><%= I18n.t('mail.order_mailer.bookmeplus_support')%></h2>
7
+ <div class="flex two-columns">
8
+ <div class="two-columns-item">
9
+ <div class="flex two-columns-item_detail">
10
+ <div class="two-columns_icon"><%= image_tag "mailer/phone.png", class: "mail-icon"%></div>
11
+ <div class="two-columns_text-container">
12
+ <p class="two-columns_title">Contact</p>
13
+ <% if @current_store.contact_phone.present? %>
14
+ <p class="two-columns_description">
15
+ <%= link_to @current_store.contact_phone, "tel:#{@current_store.contact_phone}" %>
16
+ </p>
17
+ <% end %>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ <div class="vertical-separater"></div>
22
+ <div class="two-columns-item">
23
+ <div class="flex two-columns-item_detail">
24
+ <div class="two-columns_icon"><%= image_tag "mailer/envelope.png", class: "mail-icon"%></div>
25
+ <div class="two-columns_text-container">
26
+ <p class="two-columns_title">Email</p>
27
+ <% if @current_store.customer_support_email.present? %>
28
+ <p class="two-columns_description">
29
+ <%= link_to @current_store.customer_support_email, "mailto:#{@current_store.customer_support_email}" %>
30
+ </p>
31
+ <% end %>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </td>
37
+ </tr>
38
+
39
+ <!-- Service Sections -->
40
+ <tr>
41
+ <td>
42
+ <div class="section-divider"></div>
43
+ <div class="service-sections container">
44
+ <div class="service-row">
45
+ <div class="service-info">
46
+ <h3 class="service-title">Taxi / Transfer</h3>
47
+ <p class="service-description"><strong>Pickup service</strong><br>Reserve a private taxi or shared transfer to your pickup point.</p>
48
+ <a href="#" class="btn-primary">Reserve Taxi</a>
49
+ </div>
50
+ <div class="service-image">
51
+ <img src="https://cdn.bookmebus.com/uploads/transit/vehicle_type_gallery/image/873/standard_2023-New-Car-Chinese-405km-EV-Luxury-Left-Steering-Byd-E2-Electric-Car.jpg" alt="Taxi Image">
52
+ </div>
53
+ </div>
54
+
55
+ <div class="service-row">
56
+ <div class="service-info">
57
+ <h3 class="service-title">Accommodation</h3>
58
+ <p class="service-description">Book nearby hotels with free cancellation and best price guarantee.</p>
59
+ <a href="#" class="btn-primary">Reserve Hotel</a>
60
+ </div>
61
+ <div class="service-image">
62
+ <img src="https://www.myboutiquehotel.com/photos/117447/penh-house-hotel-phnom-penh-002-56455-728x400.jpg" alt="Hotel Image">
63
+ </div>
64
+ </div>
65
+ </div>
66
+ </td>
67
+ </tr>
@@ -1,213 +1,282 @@
1
1
  <style type="text/css" rel="stylesheet" media="all">
2
- /* Custom Mailer ------------------------------ */
3
-
4
- #confirm-email {
5
- font-family: "Poppins", "Nunito Sans", Helvetica, Arial, sans-serif;
6
- font-size: 16px;
7
- }
8
- #confirm-email p {
9
- margin: 0;
10
- }
11
- #confirm-email h2 {
12
- margin-bottom: 24px;
13
- font-size: 22px;
14
- font-weight: 700;
15
- line-height: 28px;
16
- }
17
- #confirm-email hr {
18
- height: 1.5px;
19
- background-color: #dddfe2;
20
- border: none;
21
- margin: 24px 0;
22
- }
23
- .email-body_inner {
24
- background-color: transparent;
25
- padding-top: 40px;
26
- }
27
- #confirm-email .content-cell {
28
- padding: 24px;
29
- margin-bottom: 24px;
30
- border-radius: 25px;
31
- border: 1px solid #dddfe2;
32
- }
33
-
34
- #confirm-email .flex {
35
- display: flex;
36
- }
37
- #confirm-email .mtb-24 {
38
- margin: 24px 0;
39
- }
40
- #confirm-email .mb-24 {
41
- margin-bottom: 24px;
42
- }
43
- #confirm-email .mb-16 {
44
- margin-bottom: 16px;
45
- }
46
- #confirm-email .f-14 {
47
- font-size: 14px;
48
- }
49
- #confirm-email .view-map {
50
- text-decoration: none;
51
- color: #6444D8;
52
- }
53
- #confirm-email #greeting-card {
54
- color: #fff;
55
- margin-top: 40px;
56
- background: url(<%= image_path("mailer/line_item-mailer-bg.png") %>),
57
- #35ace0;
58
- }
59
- #confirm-email #greeting-card p,
60
- #confirm-email #greeting-card .hello,
61
- #confirm-email #greeting-card .description {
62
- color: #fff;
63
- }
64
- #confirm-email .align-right {
65
- vertical-align: top;
66
- }
67
- #confirm-email .icon-bookme-plus {
68
- width: 212px;
69
- margin-bottom: 56px;
70
- margin-top: 20px;
71
- }
72
- #confirm-email #greeting-card .hello {
73
- font-size: 22px;
74
- font-style: normal;
75
- font-weight: 700;
76
- line-height: 28px;
77
- margin-bottom: 12px;
78
- }
79
- #confirm-email .qr-container {
80
- padding: 20px 20px 0;
81
- text-align: center;
82
- }
83
- #confirm-email .qr-container .qr-code {
84
- width: 200px;
85
- border-radius: 26px;
86
- background-color: #fff;
87
- margin-bottom: 12px;
88
- }
89
- #confirm-email .purchase_image {
90
- padding: 0 10px 0 0;
91
- }
92
- #confirm-email .purchase_item_price {
93
- margin-bottom: 8px;
94
- }
95
- #confirm-email .purchase-summary-item {
96
- margin-top: 10px;
97
- }
98
- .purchase_total {
99
- font-weight: normal;
100
- text-align: left;
101
- }
102
- #confirm-email .purchase-summary_sub_total {
103
- margin-bottom: 14px;
104
- }
105
- #confirm-email .purchase_footer {
106
- border-top: none;
107
- }
108
- .purchase_total--label {
109
- text-align: left;
110
- }
111
- #confirm-email .vertical-separater {
112
- margin: 0 18px;
113
- width: 2px;
114
- height: auto;
115
- background: #F2F2F2;
116
- }
117
- #confirm-email .two-columns .two-columns-item {
118
- width: 45%;
119
- }
120
- #confirm-email .two-columns .two-columns-item_left {
121
- width: 43%;
122
- }
123
- #confirm-email .two-columns .two-columns-item_detail {
124
- margin-bottom: 16px;
125
- }
126
- #confirm-email .two-columns_icon {
127
- min-width: 48px;
128
- height: 48px;
129
- background: #f1f1f1;
130
- border-radius: 50%;
131
- display: flex;
132
- }
133
- #confirm-email .two-columns_icon .vendor-logo {
134
- max-width: 48px;
135
- border-radius: 50%;
136
- }
137
- #confirm-email .two-columns_text-container {
138
- margin-left: 14px;
139
- }
140
- #confirm-email .two-columns_title {
141
- color: #49454F;
142
- font-size: 16px;
143
- font-style: normal;
144
- font-weight: 400;
145
- line-height: 24px;
146
- letter-spacing: 0.1px;
147
- }
148
- #confirm-email .two-columns_description {
149
- color: #000;
150
- font-size: 16px;
151
- font-style: normal;
152
- font-weight: 400;
153
- line-height: 24px;
154
- letter-spacing: 0.1px;
155
- }
156
- #confirm-email .email-footer {
157
- padding: 24px;
158
- }
159
- #confirm-email .email-footer .email-footer_inner {
160
- color: #49454F;
161
- text-align: center;
162
- font-size: 16px;
163
- font-style: normal;
164
- font-weight: 400;
165
- line-height: 24px;
166
- letter-spacing: 0.1px;
167
- }
168
- .email-footer .email-footer_inner h2 {
169
- text-align: center;
170
- }
171
- #confirm-email .email-footer .social_icons {
172
- display: inline-block;
173
- text-align: center;
174
- }
175
- #confirm-email .email-footer .social_icon {
176
- background: #fff;
177
- border-radius: 50%;
178
- display: inline-block;
179
- padding: 12px;
180
- }
181
- #confirm-email .email-footer .social_icon i {
182
- color: #939393;
183
- font-size: 22px;
184
- }
185
- #confirm-email .email-footer .email-footer_links a {
186
- color: #6444D8;
187
- text-decoration: none;
188
- }
189
- #confirm-email .notice-info .description {
190
- padding-left: 12px;
191
- }
192
- #confirm-email .notice-info a {
193
- color: #6444D8;
194
- text-decoration: none;
195
- }
196
-
197
- @media (prefers-color-scheme: dark) {
198
- #confirm-email .content-cell {
199
- background-color: #333333;
200
- }
201
- }
202
- .mail-icon {
203
- width: 24px;
204
- height: 24px;
205
- margin: auto;
206
- }
207
-
208
- @media only screen and (max-width: 600px) {
209
- .content-cell {
210
- padding: 34px 15px !important;
211
- }
212
- }
213
- </style>
2
+ @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');
3
+
4
+ .email-content {
5
+ font-family: 'Poppins', 'Nunito Sans', Helvetica, Arial, sans-serif;
6
+ border: 1px solid #dddddd;
7
+ border-radius: 1.5625rem;
8
+ }
9
+
10
+ .container {
11
+ margin: 0 auto;
12
+ padding: 0 20px;
13
+ }
14
+
15
+ .ticket-header {
16
+ padding: 20px;
17
+ }
18
+
19
+ .ticket-info {
20
+ padding: 20px;
21
+ display: flex;
22
+ align-items: center;
23
+ justify-content: space-between;
24
+ }
25
+
26
+ .company-logo {
27
+ flex: 1;
28
+ max-width: 180px;
29
+ }
30
+
31
+ .company-logo img {
32
+ width: 100%;
33
+ height: auto;
34
+ }
35
+
36
+ .booking-details {
37
+ flex: 2;
38
+ text-align: right;
39
+ }
40
+
41
+ .booking-number {
42
+ font-size: 20px;
43
+ font-weight: 700;
44
+ margin: 10px 0;
45
+ color: #555555;
46
+ }
47
+
48
+ .issue-date,
49
+ .departure-date {
50
+ font-size: 15px;
51
+ font-weight: 700;
52
+ margin: 10px 0;
53
+ color: #000000;
54
+ }
55
+
56
+ /* Journey */
57
+ .journey-section {
58
+ background-color: #7747ff;
59
+ padding: 20px;
60
+ display: flex;
61
+ align-items: center;
62
+ justify-content: space-between;
63
+ color: white;
64
+ }
65
+
66
+ .station {
67
+ text-align: center;
68
+ flex: 1;
69
+ flex-direction: column;
70
+ justify-content: space-between;
71
+ }
72
+
73
+ .station-code {
74
+ font-size: 24px;
75
+ font-weight: 700;
76
+ margin: 0 0 10px 0;
77
+ }
78
+
79
+ .station-name {
80
+ font-size: 17px;
81
+ margin: 0;
82
+ }
83
+
84
+ .duration {
85
+ text-align: center;
86
+ flex: 1;
87
+ padding: 0 20px;
88
+ }
89
+
90
+ .duration-label {
91
+ font-size: 15px;
92
+ color: #f0efef;
93
+ margin: 0 0 5px 0;
94
+ }
95
+
96
+ .duration-time {
97
+ font-size: 15px;
98
+ color: #f0efef;
99
+ margin: 0;
100
+ }
101
+
102
+ /* Trip details */
103
+ .trip-details {
104
+ background-color: #7747ff;
105
+ padding: 20px;
106
+ display: flex;
107
+ justify-content: space-between;
108
+ color: white;
109
+ }
110
+
111
+ .detail-item {
112
+ text-align: center;
113
+ flex: 1;
114
+ }
115
+
116
+ .detail-label {
117
+ font-size: 15px;
118
+ margin-bottom: 10px;
119
+ }
120
+
121
+ .detail-value {
122
+ font-size: 18px;
123
+ font-weight: 700;
124
+ }
125
+
126
+ /* QR */
127
+ .qr-section {
128
+ text-align: center;
129
+ padding: 30px 20px;
130
+ }
131
+
132
+ .qr-code {
133
+ max-width: 162px;
134
+ margin: 0 auto 20px auto;
135
+ }
136
+
137
+ .qr-code img {
138
+ width: 100%;
139
+ height: auto;
140
+ }
141
+
142
+ .section-title {
143
+ font-size: 17px;
144
+ font-weight: 700;
145
+ color: #000000;
146
+ margin: 30px 20px 10px 20px;
147
+ }
148
+
149
+ .contact-details,
150
+ .trip-info {
151
+ padding: 0 20px;
152
+ }
153
+
154
+ .contact-details p,
155
+ .trip-info p {
156
+ font-size: 16px;
157
+ margin: 8px 0;
158
+ color: #101112;
159
+ }
160
+
161
+ /* Info table */
162
+ .info-table {
163
+ width: 100%;
164
+ border-collapse: collapse;
165
+ margin: 10px 0;
166
+ }
167
+
168
+ .info-table th {
169
+ background-color: #f2f2f2;
170
+ padding: 10px;
171
+ border: 1px solid #dddddd;
172
+ font-size: 15px;
173
+ font-weight: 700;
174
+ }
175
+
176
+ .info-table td {
177
+ padding: 10px;
178
+ border: 1px solid #dddddd;
179
+ font-size: 15px;
180
+ }
181
+
182
+ .info-table a {
183
+ color: #7747FF;
184
+ text-decoration: underline;
185
+ }
186
+
187
+ /* Booking */
188
+ .booking-summary {
189
+ padding: 20px;
190
+ }
191
+
192
+ .booking-title {
193
+ font-size: 17px;
194
+ font-weight: 700;
195
+ color: #232323;
196
+ margin: 0 0 20px 0;
197
+ }
198
+
199
+ .booking-row {
200
+ display: flex;
201
+ justify-content: space-between;
202
+ margin: 10px 0;
203
+ font-size: 15px;
204
+ }
205
+
206
+ .booking-row.total {
207
+ font-weight: 700;
208
+ font-size: 16px;
209
+ border-top: 1px solid #eee;
210
+ padding-top: 10px;
211
+ }
212
+
213
+ .terms-content {
214
+ font-size: 15px;
215
+ line-height: 1.5;
216
+ text-align: justify;
217
+ }
218
+
219
+ .terms-content a {
220
+ color: #7747FF;
221
+ text-decoration: underline;
222
+ }
223
+
224
+ /* Services */
225
+ .service-sections {
226
+ padding: 0 20px 30px 20px;
227
+ }
228
+
229
+ .service-row {
230
+ display: flex;
231
+ align-items: center;
232
+ margin-bottom: 20px;
233
+ }
234
+
235
+ .service-info {
236
+ flex: 1;
237
+ padding-right: 20px;
238
+ }
239
+
240
+ .service-title {
241
+ font-size: 17px;
242
+ font-weight: 700;
243
+ color: #232323;
244
+ margin: 0 0 10px 0;
245
+ }
246
+
247
+ .service-description {
248
+ font-size: 15px;
249
+ color: #232323;
250
+ padding: 10px 0;
251
+ line-height: 1.5;
252
+ margin: 0 0 15px 0;
253
+ }
254
+
255
+ .btn-primary {
256
+ background-color: #7747ff;
257
+ color: white;
258
+ padding: 8px 20px;
259
+ border: none;
260
+ border-radius: 30px;
261
+ font-size: 16px;
262
+ cursor: pointer;
263
+ text-decoration: none;
264
+ display: inline-block;
265
+ }
266
+
267
+ .service-image {
268
+ flex: 1;
269
+ max-width: 160px;
270
+ }
271
+
272
+ .service-image img {
273
+ width: 100%;
274
+ height: auto;
275
+ }
276
+
277
+ .section-divider {
278
+ margin: 20px 5%;
279
+ border-top: 2px dashed #dddddd;
280
+ }
281
+
282
+ </style>
@@ -0,0 +1,42 @@
1
+ <!-- Terms & Conditions -->
2
+ <tr>
3
+ <td>
4
+ <div class="section-divider"></div>
5
+ <div>
6
+ <h2 class="section-title">Terms & Conditions</h2>
7
+ <div class="terms-content container">
8
+ <p><strong>- Ticket Changes & Cancellations</strong> – For requests, please kindly us through e-mail to <a href="mailto:support@bookmebus.com">support@bookmebus.com</a> at least 48 hours before departure. Please refer to our T&C for more information <a href="https://bookmebus.com/en/terms_of_use#ticket-cancellation-and-modification">click here</a></p>
9
+
10
+ <p><strong>- Customer Support</strong> – Contact us via <a href="https://www.facebook.com/bookmebus">Facebook page</a>, or live chat with our customer support on the <a href="https://bookmebus.com/en">bookmebus website</a>, or email to us via <a href="mailto:support@bookmebus.com">support@bookmebus.com</a> Support is available daily from 8:00 AM to 7:00 PM</p>
11
+
12
+ <p><strong>1. Check-in Time</strong> – Passengers must arrive at least 15 minutes before departure to secure the trips. Late arrivals will forfeit their tickets without refund.</p>
13
+
14
+ <p><strong>2. Seat Changes</strong> – Seat numbers may be adjusted without prior notice due to unforeseen circumstances or operational requirements.</p>
15
+
16
+ <p><strong>3. Connecting Trips</strong> – We kindly recommend allowing ample time between connections. BookMeBus cannot be held responsible for any missed onward travel.</p>
17
+
18
+ <p><strong>4. Vehicle Changes</strong> – Bus operators may substitute vehicles without prior notice in the event of unforeseen circumstances.</p>
19
+
20
+ <p><strong>5. Delayed Departure Time</strong> – No compensation will be provided in the event of delays caused by unforeseen circumstances such as weather, traffic, border procedures, or mechanical issues.</p>
21
+
22
+ <p><strong>6. Complimentary Services</strong> – Free amenities (Wi-Fi, snacks, entertainment) are not guaranteed and non-refundable.</p>
23
+
24
+ <p><strong>7. Estimated Travel Duration</strong> – Travel duration is estimated based on the bus operator's experience and may take longer than expected due to road, weather, immigration, or other delays.</p>
25
+
26
+ <p><strong>8. Infant & Child Policy</strong> – Infants under 3 years travel free when seated on an adult's lap. Children aged 4 and above require a paid seat.</p>
27
+
28
+ <p><strong>9. Baggage Allowance</strong> – Each passenger may bring one piece of luggage (up to 20 kg for buses or 15 kg for vans) and one small cabin bag. Overweight items may incur additional charges, payable directly to the bus operator at the station.</p>
29
+
30
+ <p><strong>10. Personal Belongings</strong> – Passengers are responsible for their belongings; bus operators are not liable for loss or damage.</p>
31
+
32
+ <p><strong>11. Prohibited Items</strong> – Pets, livestock, weapons, hazardous materials, and strong-smelling food are not allowed.</p>
33
+
34
+ <p><strong>12. ID & Travel Documents</strong> – A valid ID, passport, and any required visas must be presented. No refunds will be provided if boarding is denied due to missing documents.</p>
35
+
36
+ <p><strong>13. Indirect Trips</strong> – For inter-province or cross-border trips, you may need to change to a van, different bus, or night bus at certain stops, depending on your booking and availability.</p>
37
+
38
+ <p><strong>14. Operator Responsibility</strong> – BookMeBus is a booking platform that displays bus operators' schedules and availability. Service delivery is the sole responsibility of each partner operator.</p>
39
+ </div>
40
+ </div>
41
+ </td>
42
+ </tr>
@@ -1,15 +1,185 @@
1
- <%= render 'spree_cm_commissioner/guest_mailer/mailer_stylesheets' %>
2
-
3
- <table class="email-body" width="100%" cellpadding="0" cellspacing="0" role="presentation">
4
- <tr>
5
- <td align="center">
6
- <table class="email-body_inner" width="570" cellpadding="0" cellspacing="0" role="presentation">
7
- <tr>
8
- <td id="confirm-email">
9
- <%= render 'spree_cm_commissioner/guest_mailer/greeting', order: @order, line_item: @line_item, guest: @guest %>
10
- </td>
11
- </tr>
1
+
2
+ <!-- Header -->
3
+ <tr>
4
+ <td class="ticket-header container">
5
+ <%= image_tag "mailer/bookme-plus_light.svg", class: "icon-bookme-plus"%>
6
+ <h3>THANK YOU FOR BOOKING WITH US!</h3>
7
+ <p>Please show this ticket to the inspector when boarding</p>
8
+ </td>
9
+ </tr>
10
+
11
+ <!-- Ticket Information -->
12
+ <tr>
13
+ <td>
14
+ <div class="ticket-info">
15
+ <div class="company-logo">
16
+ <% if @logo_src.presence %>
17
+ <%= image_tag @logo_src, alt: @vendor.name, style: 'max-height: 50px;' %>
18
+ <% else %>
19
+ <%= @vendor.name %>
20
+ <% end %>
21
+ </div>
22
+ <div class="booking-details">
23
+ <div class="booking-number">Booking ID: <%= link_to @order.number, '#' %></div>
24
+ <div class="issue-date">Issued Date: <%= @order.created_at.strftime("%a, %b %d, %Y %I:%M %p") %></div>
25
+ <div class="departure-date">Departure at: <%= @line_item.from_date.strftime("%a, %b %d, %Y %I:%M %p") %></div>
26
+ </div>
27
+ </div>
28
+ </td>
29
+ </tr>
30
+
31
+ <!-- Journey Section -->
32
+ <tr>
33
+ <td>
34
+ <div class="journey-section">
35
+ <div class="station">
36
+ <p class="station-code"><%= (@trip.origin_place.name) %></p>
37
+ </div>
38
+ <div class="duration">
39
+ <p class="duration-label">Duration</p>
40
+ <% duration = @trip.duration_in_hms %>
41
+ <p class="duration-time"><%= duration[:hours] %>hr <%= duration[:minutes] %>m</p>
42
+ </div>
43
+ <div class="station">
44
+ <p class="station-code"><%= (@trip.destination_place.name) %></p>
45
+ </div>
46
+ </div>
47
+ </td>
48
+ </tr>
49
+
50
+ <!-- Trip Details -->
51
+ <tr>
52
+ <td>
53
+ <div class="divider"></div>
54
+
55
+ <div class="trip-details">
56
+ <div class="detail-item">
57
+ <p class="detail-label">Vehicle</p>
58
+ <p class="detail-value"><%= @trip.vehicle.vehicle_type.capitalize %></p>
59
+ </div>
60
+ <div class="detail-item">
61
+ <p class="detail-label">Seat</p>
62
+ <p class="detail-value"><%= @guest&.block&.label || @line_item.variant.options_text %></p>
63
+ </div>
64
+ <% if @guest.nationality %>
65
+ <div class="detail-item">
66
+ <p class="detail-label">Nationality</p>
67
+ <p class="detail-value"><%= @guest.nationality %></p>
68
+ </div>
69
+ <% end %>
70
+ </div>
71
+ </td>
72
+ </tr>
73
+
74
+ <!-- QR Code Section -->
75
+ <tr>
76
+ <td>
77
+ <div class="qr-section">
78
+ <div class="qr-code">
79
+ <% if (png_obj = @guest.generate_png_qr) %>
80
+ <% png_binary = if png_obj.respond_to?(:to_blob)
81
+ png_obj.to_blob
82
+ elsif png_obj.respond_to?(:to_s)
83
+ png_obj.to_s
84
+ else
85
+ png_obj
86
+ end %>
87
+ <% base64_png = Base64.strict_encode64(png_binary) rescue Base64.encode64(png_binary.to_s) %>
88
+ <%= image_tag "data:image/png;base64,#{base64_png}", style: "width: 120px; height: 120px; border-radius: 10px;", alt: 'guest-qr' %>
89
+ <% end %>
90
+ </div>
91
+ <a href="#" class="btn-primary">Download ticket</a>
92
+ </div>
93
+ </td>
94
+ </tr>
95
+ <!-- Passenger Details -->
96
+ <tr>
97
+ <td>
98
+ <div class="section-divider"></div>
99
+ <h2 class="section-title">Passenger Details</h2>
100
+ <div class="contact-details container">
101
+ <% display_guest = @guest.saved_guest %>
102
+ <% if display_guest.phone_number.present? %>
103
+ <p class="two-columns_description">
104
+ Tel: <%= link_to(
105
+ display_guest.phone_number,
106
+ "tel:#{display_guest.phone_number}")
107
+ %>
108
+ </p>
109
+ <% end %>
110
+ <p>Name: <%= display_guest&.full_name %></p>
111
+ <p>Email: <%= display_guest&.email %></p>
112
+ </div>
113
+ </td>
114
+ </tr>
115
+ <!-- Contact Details -->
116
+ <tr>
117
+ <td>
118
+ <div class="section-divider"></div>
119
+ <h2 class="section-title">Passenger Contact Details</h2>
120
+ <div class="contact-details container">
121
+ <% if @order.phone_number.present? || @order.intel_phone_number.present? %>
122
+ <p class="two-columns_description">
123
+ Tel: <%= link_to(
124
+ @order.phone_number || @order.intel_phone_number,
125
+ "tel:#{@order.phone_number || @order.intel_phone_number}")
126
+ %>
127
+ </p>
128
+ <% end %>
129
+ <p>Email: <%= @order.email %></p>
130
+ </div>
131
+ </td>
132
+ </tr>
133
+
134
+ <!-- Trip Information -->
135
+ <tr>
136
+ <td>
137
+ <div class="section-divider"></div>
138
+ <h2 class="section-title">Trip Information</h2>
139
+ <div class="trip-info">
140
+ <p>Phone: <%= @vendor.contact_us %></p>
141
+ <p>Email: <%= @vendor.notification_email %></p>
142
+ <table class="info-table">
143
+ <thead>
144
+ <tr>
145
+ <th></th>
146
+ <th>Time</th>
147
+ </tr>
148
+ </thead>
149
+ <tbody>
150
+ <% if @trip&.trip_stops.present? %>
151
+ <% @trip.trip_stops.order(:sequence).each do |stop| %>
152
+ <tr>
153
+ <td>
154
+ <span class="stop-type <%= stop.stop_type %>"><%= stop.stop_type.to_s.titleize %></span>
155
+ <div class="stop-name"><strong><%= stop.stop_name %></strong></div>
156
+ <% if stop.respond_to?(:location_place) && stop.location_place.present? %>
157
+ <% if stop.location_place.respond_to?(:address) && stop.location_place.address.present? %>
158
+ <div class="stop-address"><%= stop.location_place.address %></div>
159
+ <% end %>
160
+ <% end %>
161
+ </td>
162
+ <td>
163
+ <% time = stop.departure_time || stop.arrival_time %>
164
+ <div class="stop-time"><%= time.present? ? time.strftime("%H:%M") : '-' %></div>
165
+ <% lat = nil; lng = nil %>
166
+ <% if stop.respond_to?(:stop_place) && stop.stop_place.present? && stop.stop_place.respond_to?(:lat) && stop.stop_place.respond_to?(:lon) %>
167
+ <% lat = stop.stop_place.lat; lng = stop.stop_place.lon %>
168
+ <% elsif stop.respond_to?(:lat) && stop.respond_to?(:lon) && stop.lat.present? && stop.lon.present? %>
169
+ <% lat = stop.lat; lng = stop.lon %>
170
+ <% end %>
171
+ <% if lat.present? && lng.present? %>
172
+ <div class="map-link"><a href="https://maps.google.com/?q=<%= lat %>,<%= lng %>" target="_blank">View map here</a></div>
173
+ <% end %>
174
+ </td>
175
+ </tr>
176
+ <% end %>
177
+ <% end %>
178
+ </tbody>
12
179
  </table>
13
- </td>
14
- </tr>
15
- </table>
180
+ </div>
181
+ </td>
182
+ </tr>
183
+
184
+ <%= render 'spree_cm_commissioner/guest_mailer/terms_and_conditions' %>
185
+ <%= render 'spree_cm_commissioner/guest_mailer/footer' %>
@@ -6,14 +6,14 @@
6
6
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
7
7
  <link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
8
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
9
- <%= render partial: 'spree/shared/base_mailer_stylesheets' %>
10
9
  <%= render partial: 'spree_cm_commissioner/guest_mailer/mailer_stylesheets' %>
10
+ <%= render partial: 'spree_cm_commissioner/order_mailer/mailer_stylesheets' %>
11
11
  </head>
12
12
  <body>
13
13
  <table class="email-wrapper" width="100%" cellpadding="0" cellspacing="0" role="presentation" id="confirm-email">
14
14
  <tr>
15
15
  <td align="center">
16
- <table class="email-content" width="100%" cellpadding="0" cellspacing="0" role="presentation">
16
+ <table class="email-content" width="570" cellpadding="0" cellspacing="0" role="presentation">
17
17
  <!-- Email Body -->
18
18
  <%= yield%>
19
19
  </table>
@@ -1,5 +1,5 @@
1
1
  module SpreeCmCommissioner
2
- VERSION = '2.1.5-pre5'.freeze
2
+ VERSION = '2.1.5-pre6'.freeze
3
3
 
4
4
  module_function
5
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_cm_commissioner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.5.pre.pre5
4
+ version: 2.1.5.pre.pre6
5
5
  platform: ruby
6
6
  authors:
7
7
  - You
@@ -2319,8 +2319,9 @@ files:
2319
2319
  - app/views/spree_cm_commissioner/event_transactional_mailer/send_to_organizer.html.erb
2320
2320
  - app/views/spree_cm_commissioner/event_transactional_mailer/send_to_participant.html.erb
2321
2321
  - app/views/spree_cm_commissioner/guest_cards/show.html.erb
2322
- - app/views/spree_cm_commissioner/guest_mailer/_greeting.html.erb
2322
+ - app/views/spree_cm_commissioner/guest_mailer/_footer.html.erb
2323
2323
  - app/views/spree_cm_commissioner/guest_mailer/_mailer_stylesheets.html.erb
2324
+ - app/views/spree_cm_commissioner/guest_mailer/_terms_and_conditions.html.erb
2324
2325
  - app/views/spree_cm_commissioner/guest_mailer/send_ticket_to_guest.html.erb
2325
2326
  - app/views/spree_cm_commissioner/layouts/crew_invite_mailer.html.erb
2326
2327
  - app/views/spree_cm_commissioner/layouts/event_transactional_mailer.html.erb
@@ -1,14 +0,0 @@
1
- <div class="content-cell flex" id="greeting-card">
2
- <div>
3
- <%= image_tag "mailer/bookme-plus.png", class: "icon-bookme-plus"%>
4
- <div class="hello"><%= I18n.t('mail.order_mailer.hello', full_name: user_full_name(order))%></div>
5
- <div class="description">
6
- <%= I18n.t('mail.order_mailer.booking_event', order_number: line_item.number || 'NA') %>
7
- </div>
8
- </div>
9
-
10
- <div class="qr-container">
11
- <%= image_tag main_app.url_for("/li/#{line_item.id}"), class: 'qr-code' %>
12
- <p>Show your QR to enter</p>
13
- </div>
14
- </div>