spree_emails 6.0.0.rc4 → 6.0.0.rc6

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: 8b36e110ec9015b77d39145f10563eae41ad4c394dd10aaa9f6d4d3bef5a9f76
4
- data.tar.gz: '0823eef14071ef5d4daec65492ddbc0ebfa5d1fd900f1a6ab04193ce9781e797'
3
+ metadata.gz: ea630ade954b2c48e6a43fac3a47575dd665b56fb6983aa76767e12274fcaf31
4
+ data.tar.gz: 15ece1bb35f725ac704927ba9c3284a88100a98fa193d2fec4db5e88cfa28321
5
5
  SHA512:
6
- metadata.gz: f48a1be065a0bc1f1f59bb3eab63e020e64095770d4546337e6ea523af40c8564527d3789fc5c6ff8909719a77bf41bd9dc66850b0b84b32ca30b6f5e74a335e
7
- data.tar.gz: ee58c5ab0ae6077bea4f2ccf7b2af58b6604bd0e4f9eb4f14a4986e58cc4a6a6c843c3ba654f56addec9137b50902d06dc59547c83661a2f4d98e60d1382d7c5
6
+ metadata.gz: d2692c4910601a7560781b75f319d06340a587725537d4cee8e70aa43c700e1ec07f0083f9b5a2cf0cd36d82fe7bb40e973fc34f1d07bdbb16100ac2c8a769d9
7
+ data.tar.gz: 3629776fb76d8a6e1c1685aabb562fb3dbd1e441a9d64f4372bafb5e611627c1ec68534a6d454b5ae6188fcd1b0e1fa07a3041f1ce0c27a2524be7e7d53166d4
@@ -17,6 +17,24 @@ module Spree
17
17
  end
18
18
  end
19
19
 
20
+ # Asks the person to confirm a data request raised from their account
21
+ # (`data_request.confirmation_requested`). The link goes to the validated
22
+ # redirect URL when the storefront supplied one, falling back to the store's
23
+ # storefront URL, with the confirmation token appended.
24
+ def data_request_confirmation_email(data_request, confirmation_token, redirect_url: nil)
25
+ @data_request = data_request
26
+ @current_store = data_request.store
27
+ @confirmation_url = append_token(redirect_url.presence || @current_store.storefront_url, confirmation_token)
28
+ @expires_at = data_request.requested_at + Spree::DataRequest::CONFIRMATION_WINDOW
29
+
30
+ with_store_locale(@current_store) do
31
+ mail_template(
32
+ { kind: data_request.kind, confirmation_url: @confirmation_url, expires_at: @expires_at.iso8601 },
33
+ to: data_request.email, store_url: @current_store.storefront_url
34
+ )
35
+ end
36
+ end
37
+
20
38
  # The finished subject access export (GDPR Art. 15). The link is signed
21
39
  # and expires with the request, so the file is reachable by the person who
22
40
  # asked for it and not by anyone who later reads the mailbox.
@@ -1,6 +1,7 @@
1
1
  module Spree
2
2
  module Emails
3
3
  class AddressSerializer < Spree::Api::V3::AddressSerializer
4
+ _attributes.delete(:owner)
4
5
  end
5
6
  end
6
7
  end
@@ -0,0 +1,15 @@
1
+ module Spree
2
+ module Emails
3
+ module Samples
4
+ class DataRequestConfirmation < Base
5
+ def variables
6
+ {
7
+ kind: Spree::DataRequest::ACCESS,
8
+ confirmation_url: placeholder_url('account/data-requests/confirm'),
9
+ expires_at: Spree::DataRequest::CONFIRMATION_WINDOW.from_now.iso8601
10
+ }
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spree
4
+ # Asks the person to confirm a request raised from their account, at the
5
+ # address the request names, before Spree acts on it.
6
+ class DataRequestConfirmationEmailSubscriber < Spree::Subscriber
7
+ subscribes_to 'data_request.confirmation_requested'
8
+
9
+ def handle(event)
10
+ data_request = Spree::DataRequest.find_by_prefix_id(event.payload['id'])
11
+ return unless data_request&.confirmable?
12
+ return unless data_request.store.prefers_send_consumer_transactional_emails?
13
+
14
+ CustomerMailer.data_request_confirmation_email(
15
+ data_request,
16
+ event.payload['confirmation_token'],
17
+ redirect_url: event.payload['redirect_url']
18
+ ).deliver_later
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,22 @@
1
+ ---
2
+ subject: "{{ store.name }} {% if kind == 'erasure' %}{{ 'customer_mailer.data_request_confirmation_email.erasure.subject' | t }}{% else %}{{ 'customer_mailer.data_request_confirmation_email.access.subject' | t }}{% endif %}"
3
+ ---
4
+ <mj-section>
5
+ <mj-column css-class="hero">
6
+ {% if kind == 'erasure' %}
7
+ <mj-text mj-class="heading">{{ 'customer_mailer.data_request_confirmation_email.erasure.subject' | t }}</mj-text>
8
+ <mj-text mj-class="greeting">{{ 'customer_mailer.data_request_confirmation_email.greeting' | t }}</mj-text>
9
+ <mj-text mj-class="lead">{{ 'customer_mailer.data_request_confirmation_email.erasure.instructions' | t }}</mj-text>
10
+ {% else %}
11
+ <mj-text mj-class="heading">{{ 'customer_mailer.data_request_confirmation_email.access.subject' | t }}</mj-text>
12
+ <mj-text mj-class="greeting">{{ 'customer_mailer.data_request_confirmation_email.greeting' | t }}</mj-text>
13
+ <mj-text mj-class="lead">{{ 'customer_mailer.data_request_confirmation_email.access.instructions' | t }}</mj-text>
14
+ {% endif %}
15
+ <mj-button href="{{ confirmation_url }}">{{ 'customer_mailer.data_request_confirmation_email.action' | t }}</mj-button>
16
+ {% if expires_at %}
17
+ {% assign expires_on = expires_at | date: 'long' %}
18
+ <mj-text mj-class="note">{{ 'customer_mailer.data_request_confirmation_email.expiry_notice' | t: date: expires_on }}</mj-text>
19
+ {% endif %}
20
+ <mj-text mj-class="note" padding="16px 0 0">{{ 'customer_mailer.data_request_confirmation_email.ignore_notice' | t }}</mj-text>
21
+ </mj-column>
22
+ </mj-section>
@@ -18,6 +18,17 @@ en:
18
18
  ignore_notice: If you did not request a copy of your data, please contact us.
19
19
  instructions: Your copy of the personal data we hold about you is ready. Use the button below to download it.
20
20
  subject: Your Data Is Ready to Download
21
+ data_request_confirmation_email:
22
+ access:
23
+ instructions: We received a request for a copy of the personal data we hold about you. Once you confirm it, we will email you a link to download the file.
24
+ subject: Confirm Your Data Request
25
+ action: Review and Confirm
26
+ erasure:
27
+ instructions: We received a request to permanently erase the personal data we hold about you, including the names and addresses on your past orders. This cannot be undone.
28
+ subject: Confirm Your Erasure Request
29
+ expiry_notice: This link expires on %{date}.
30
+ greeting: Hello,
31
+ ignore_notice: If you did not make this request, you can ignore this email and nothing will happen.
21
32
  password_reset_email:
22
33
  action: Reset Password
23
34
  expiry_notice: This password reset link will expire shortly. If you did not request this, no action is needed.
@@ -28,6 +28,7 @@ module Spree
28
28
  'spree/digital_asset_mailer/files_ready_email' => 'Spree::Emails::Samples::Downloads',
29
29
  'spree/customer_mailer/password_reset_email' => 'Spree::Emails::Samples::PasswordReset',
30
30
  'spree/customer_mailer/data_export_email' => 'Spree::Emails::Samples::DataExport',
31
+ 'spree/customer_mailer/data_request_confirmation_email' => 'Spree::Emails::Samples::DataRequestConfirmation',
31
32
  'spree/newsletter_mailer/email_confirmation' => 'Spree::Emails::Samples::NewsletterConfirmation',
32
33
  'spree/company_mailer/invitation_email' => 'Spree::Emails::Samples::CompanyInvitation'
33
34
  }.each { |key, sample| Spree.editable_email_templates.register(key, kind: :email, sample: sample) }
@@ -48,6 +49,7 @@ module Spree
48
49
  Spree::NewsletterSubscriberEmailSubscriber,
49
50
  Spree::CustomerEmailSubscriber,
50
51
  Spree::DataRequestEmailSubscriber,
52
+ Spree::DataRequestConfirmationEmailSubscriber,
51
53
  Spree::CompanyEmailSubscriber,
52
54
  Spree::DigitalAssetEmailSubscriber,
53
55
  Spree::SellerEmailSubscriber
@@ -12,6 +12,15 @@ class Spree::CustomerPreview < ActionMailer::Preview
12
12
  )
13
13
  end
14
14
 
15
+ def data_request_confirmation_email
16
+ data_request = Spree::DataRequest.new(
17
+ store: Spree::PreviewData.store(locale), kind: Spree::DataRequest::ERASURE,
18
+ email: Spree::PreviewData.customer.email, requested_at: Time.current
19
+ )
20
+
21
+ Spree::CustomerMailer.data_request_confirmation_email(data_request, 'preview-token')
22
+ end
23
+
15
24
  def data_export_email
16
25
  Spree::CustomerMailer.data_export_email(Spree::DataRequest.access.with_status(:completed).last)
17
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_emails
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.rc4
4
+ version: 6.0.0.rc6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2026-10-19 00:00:00.000000000 Z
13
+ date: 2026-10-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: spree
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 6.0.0.rc4
21
+ version: 6.0.0.rc6
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 6.0.0.rc4
28
+ version: 6.0.0.rc6
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: email_spec
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -90,6 +90,7 @@ files:
90
90
  - app/services/spree/emails/samples/base.rb
91
91
  - app/services/spree/emails/samples/company_invitation.rb
92
92
  - app/services/spree/emails/samples/data_export.rb
93
+ - app/services/spree/emails/samples/data_request_confirmation.rb
93
94
  - app/services/spree/emails/samples/downloads.rb
94
95
  - app/services/spree/emails/samples/fulfillment.rb
95
96
  - app/services/spree/emails/samples/newsletter_confirmation.rb
@@ -100,6 +101,7 @@ files:
100
101
  - app/services/spree/emails/samples/return.rb
101
102
  - app/subscribers/spree/company_email_subscriber.rb
102
103
  - app/subscribers/spree/customer_email_subscriber.rb
104
+ - app/subscribers/spree/data_request_confirmation_email_subscriber.rb
103
105
  - app/subscribers/spree/data_request_email_subscriber.rb
104
106
  - app/subscribers/spree/digital_asset_email_subscriber.rb
105
107
  - app/subscribers/spree/fulfillment_email_subscriber.rb
@@ -110,6 +112,7 @@ files:
110
112
  - app/subscribers/spree/seller_email_subscriber.rb
111
113
  - app/views/spree/company_mailer/invitation_email.liquid
112
114
  - app/views/spree/customer_mailer/data_export_email.liquid
115
+ - app/views/spree/customer_mailer/data_request_confirmation_email.liquid
113
116
  - app/views/spree/customer_mailer/password_reset_email.liquid
114
117
  - app/views/spree/digital_asset_mailer/files_ready_email.liquid
115
118
  - app/views/spree/fulfillment_mailer/fulfilled_email.liquid
@@ -190,9 +193,9 @@ licenses:
190
193
  - BSD-3-Clause
191
194
  metadata:
192
195
  bug_tracker_uri: https://github.com/spree/spree/issues
193
- changelog_uri: https://github.com/spree/spree/releases/tag/v6.0.0.rc4
196
+ changelog_uri: https://github.com/spree/spree/releases/tag/v6.0.0.rc6
194
197
  documentation_uri: https://docs.spreecommerce.org/
195
- source_code_uri: https://github.com/spree/spree/tree/v6.0.0.rc4
198
+ source_code_uri: https://github.com/spree/spree/tree/v6.0.0.rc6
196
199
  post_install_message:
197
200
  rdoc_options: []
198
201
  require_paths: