From 53a12edf022437a07dfb504bd95aa0395372abb5 Mon Sep 17 00:00:00 2001 From: Dat Date: Mon, 3 Aug 2026 16:54:43 +0200 Subject: [PATCH 1/7] feat(api): Send a global notification regarding the policy update --- app/Jobs/SendPolicyAnnouncementJob.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 app/Jobs/SendPolicyAnnouncementJob.php diff --git a/app/Jobs/SendPolicyAnnouncementJob.php b/app/Jobs/SendPolicyAnnouncementJob.php new file mode 100644 index 00000000..0f59653f --- /dev/null +++ b/app/Jobs/SendPolicyAnnouncementJob.php @@ -0,0 +1,22 @@ + Date: Tue, 4 Aug 2026 14:20:02 +0200 Subject: [PATCH 2/7] Add test class --- tests/Jobs/SendPolicyAnnouncementJobTest.php | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/Jobs/SendPolicyAnnouncementJobTest.php diff --git a/tests/Jobs/SendPolicyAnnouncementJobTest.php b/tests/Jobs/SendPolicyAnnouncementJobTest.php new file mode 100644 index 00000000..dd80c7f0 --- /dev/null +++ b/tests/Jobs/SendPolicyAnnouncementJobTest.php @@ -0,0 +1,29 @@ +create(); + } + + $users = User::all(); + + $job = new SendPolicyAnnouncementJob(); + $job->handle(); + + Notification::assertSentTo($users, PolicyAnnouncementNotification::class); + } +} From 4e205a60a0f98bc6483cd88734aa48c7e3a89f48 Mon Sep 17 00:00:00 2001 From: Dat Date: Tue, 4 Aug 2026 14:20:19 +0200 Subject: [PATCH 3/7] Add SendPolicyAnnouncementJob job class --- app/Jobs/SendPolicyAnnouncementJob.php | 15 ++--- .../PolicyAnnouncementNotification.php | 56 +++++++++++++++++++ 2 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 app/Notifications/PolicyAnnouncementNotification.php diff --git a/app/Jobs/SendPolicyAnnouncementJob.php b/app/Jobs/SendPolicyAnnouncementJob.php index 0f59653f..b4b48b98 100644 --- a/app/Jobs/SendPolicyAnnouncementJob.php +++ b/app/Jobs/SendPolicyAnnouncementJob.php @@ -2,21 +2,14 @@ namespace App\Jobs; -use App\Policy; -use App\PolicyAnnouncement; -use App\PolicyAcceptance; +use App\Notifications\PolicyAnnouncementNotification; use App\User; +use Illuminate\Support\Facades\Notification; class SendPolicyAnnouncementJob extends Job { - public function handle() { - $users = User::all(); + $users = User::query()->whereNotNull('email')->get(); - foreach ($users as $user) { - // Here you would send the announcement to the user - // you might dispatch a notification or an email - // This is just a placeholder for the actual sending logic - // Notification::send($user, new PolicyAnnouncementNotification($policyAnnouncement)); - } + Notification::send($users, new PolicyAnnouncementNotification()); } } diff --git a/app/Notifications/PolicyAnnouncementNotification.php b/app/Notifications/PolicyAnnouncementNotification.php new file mode 100644 index 00000000..0f422dde --- /dev/null +++ b/app/Notifications/PolicyAnnouncementNotification.php @@ -0,0 +1,56 @@ + + */ + public function via($notifiable): array { + return ['mail']; + } + + /** + * Build the mail representation of the notification. + * + * @param mixed $notifiable + */ + public function toMail($notifiable): MailMessage { + return (new MailMessage()) + ->from('noreply@wikibase.cloud', 'Wikibase Cloud') + ->subject(Lang::get('Please review and accept the updated Terms of Use and new Hosting Policy')) + ->greeting(Lang::get('Dear Wikibase Cloud user,')) + ->line(new HtmlString(Lang::get('We\'ve made two updates to the agreements that help run and maintain Wikibase Cloud. Please review and accept them if you agree. You can do it by logging in to the website.'))) + ->line('') + ->line(Lang::get('What are we talking about and why is that important?')) + ->line('') + ->line(Lang::get('1. Updated Terms of Use')) + ->line(Lang::get('In order to comply with the European Union\'s Digital Services Act (DSA) and to build more transparency on how Wikibase Cloud works, we\'ve revised our Terms of Use. The main additions are a clear way to report illegal content, an explanation of how we handle content moderation, and a complaints-and-appeals process. These changes don\'t affect how you build or run your Wikibases.')) + ->line('') + ->line(Lang::get('2. New Hosting Policy')) + ->line(new HtmlString(Lang::get('We\'re introducing a Hosting Policy for the first time. As a mission-driven non-profit, Wikimedia Deutschland wants Wikibase Cloud to be used purposefully and in line with our mission, that is: hosting open knowledge that serves the public and strengthens the wider Wikibase Ecosystem. The policy indicates driving factors for what the platform is for as well as the kinds of projects it\'s here to support, and lastly the basic expectations for Wikibases hosted on it.'))) + ->line('') + ->line(new HtmlString(Lang::get('For now, we ask you to read through the documents when you log in next, and decide whether you agree with them. We want to add that we can no longer maintain your Wikibase in case you do not agree with these changes. Read the Terms of Use and the Hosting Policy.'))) + ->line('') + ->line(Lang::get('Please note that nothing changes for your Wikibase today.')) + ->line('') + ->line(Lang::get('One thing to know for later')) + ->line(Lang::get('Starting at the end of September, the Hosting Policy introduces a temporary-by-default model. To keep your Wikibase online long-term, you\'ll submit it for a short review, and you\'ll have 3 months to do so. We\'ll explain exactly how later - no Wikibase will be affected without clear notice.')) + ->line('') + ->line(Lang::get('We\'d encourage you to read the Hosting Policy now and consider whether your Wikibase fits what Wikibase Cloud is for. If it\'s a good fit, the review will be straightforward. If it isn\'t, it\'s better to know early - you\'ll have time to export your data and find a new home for it by the end of the year.')) + ->line('') + ->line(new HtmlString(Lang::get('Feel free to contact us if any of the above needs clarification on your end.'))) + ->line('') + ->line(Lang::get('Thanks for embarking on this journey with us!')) + ->line('') + ->line(Lang::get('The Wikibase Cloud team')); + } +} From 6681bb6cf06c105c547ad4d9aa686dda9c03cd0a Mon Sep 17 00:00:00 2001 From: Dat Date: Tue, 4 Aug 2026 14:53:43 +0200 Subject: [PATCH 4/7] Adjust email styling --- app/Notifications/PolicyAnnouncementNotification.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Notifications/PolicyAnnouncementNotification.php b/app/Notifications/PolicyAnnouncementNotification.php index 0f422dde..a72097c4 100644 --- a/app/Notifications/PolicyAnnouncementNotification.php +++ b/app/Notifications/PolicyAnnouncementNotification.php @@ -5,7 +5,6 @@ use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Notification; use Illuminate\Support\Facades\Lang; -use Illuminate\Support\HtmlString; class PolicyAnnouncementNotification extends Notification { /** @@ -30,12 +29,12 @@ public function toMail($notifiable): MailMessage { ->greeting(Lang::get('Dear Wikibase Cloud user,')) ->line(new HtmlString(Lang::get('We\'ve made two updates to the agreements that help run and maintain Wikibase Cloud. Please review and accept them if you agree. You can do it by logging in to the website.'))) ->line('') - ->line(Lang::get('What are we talking about and why is that important?')) + ->line(new HtmlString(Lang::get('What are we talking about and why is that important?'))) ->line('') - ->line(Lang::get('1. Updated Terms of Use')) + ->line(new HtmlString(Lang::get('

1. Updated Terms of Use

'))) ->line(Lang::get('In order to comply with the European Union\'s Digital Services Act (DSA) and to build more transparency on how Wikibase Cloud works, we\'ve revised our Terms of Use. The main additions are a clear way to report illegal content, an explanation of how we handle content moderation, and a complaints-and-appeals process. These changes don\'t affect how you build or run your Wikibases.')) ->line('') - ->line(Lang::get('2. New Hosting Policy')) + ->line(new HtmlString(Lang::get('

2. New Hosting Policy

'))) ->line(new HtmlString(Lang::get('We\'re introducing a Hosting Policy for the first time. As a mission-driven non-profit, Wikimedia Deutschland wants Wikibase Cloud to be used purposefully and in line with our mission, that is: hosting open knowledge that serves the public and strengthens the wider Wikibase Ecosystem. The policy indicates driving factors for what the platform is for as well as the kinds of projects it\'s here to support, and lastly the basic expectations for Wikibases hosted on it.'))) ->line('') ->line(new HtmlString(Lang::get('For now, we ask you to read through the documents when you log in next, and decide whether you agree with them. We want to add that we can no longer maintain your Wikibase in case you do not agree with these changes. Read the Terms of Use and the Hosting Policy.'))) From 49598fb594733773547a3759b3c5efb636f69cb5 Mon Sep 17 00:00:00 2001 From: Dat Date: Wed, 5 Aug 2026 17:01:46 +0200 Subject: [PATCH 5/7] minor fix --- app/Notifications/PolicyAnnouncementNotification.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Notifications/PolicyAnnouncementNotification.php b/app/Notifications/PolicyAnnouncementNotification.php index a72097c4..e9c838a3 100644 --- a/app/Notifications/PolicyAnnouncementNotification.php +++ b/app/Notifications/PolicyAnnouncementNotification.php @@ -5,6 +5,7 @@ use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Notification; use Illuminate\Support\Facades\Lang; +use Illuminate\Support\HtmlString; class PolicyAnnouncementNotification extends Notification { /** @@ -41,7 +42,7 @@ public function toMail($notifiable): MailMessage { ->line('') ->line(Lang::get('Please note that nothing changes for your Wikibase today.')) ->line('') - ->line(Lang::get('One thing to know for later')) + ->line(Lang::get('

One thing to know for later

')) ->line(Lang::get('Starting at the end of September, the Hosting Policy introduces a temporary-by-default model. To keep your Wikibase online long-term, you\'ll submit it for a short review, and you\'ll have 3 months to do so. We\'ll explain exactly how later - no Wikibase will be affected without clear notice.')) ->line('') ->line(Lang::get('We\'d encourage you to read the Hosting Policy now and consider whether your Wikibase fits what Wikibase Cloud is for. If it\'s a good fit, the review will be straightforward. If it isn\'t, it\'s better to know early - you\'ll have time to export your data and find a new home for it by the end of the year.')) From 55e1c84c70ca18c36fd89cd98acf3933006c8d7a Mon Sep 17 00:00:00 2001 From: Dat Date: Thu, 6 Aug 2026 10:00:09 +0200 Subject: [PATCH 6/7] fix formatting --- app/Notifications/PolicyAnnouncementNotification.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Notifications/PolicyAnnouncementNotification.php b/app/Notifications/PolicyAnnouncementNotification.php index e9c838a3..be571b5f 100644 --- a/app/Notifications/PolicyAnnouncementNotification.php +++ b/app/Notifications/PolicyAnnouncementNotification.php @@ -42,7 +42,7 @@ public function toMail($notifiable): MailMessage { ->line('') ->line(Lang::get('Please note that nothing changes for your Wikibase today.')) ->line('') - ->line(Lang::get('

One thing to know for later

')) + ->line(new HtmlString(Lang::get('

One thing to know for later

'))) ->line(Lang::get('Starting at the end of September, the Hosting Policy introduces a temporary-by-default model. To keep your Wikibase online long-term, you\'ll submit it for a short review, and you\'ll have 3 months to do so. We\'ll explain exactly how later - no Wikibase will be affected without clear notice.')) ->line('') ->line(Lang::get('We\'d encourage you to read the Hosting Policy now and consider whether your Wikibase fits what Wikibase Cloud is for. If it\'s a good fit, the review will be straightforward. If it isn\'t, it\'s better to know early - you\'ll have time to export your data and find a new home for it by the end of the year.')) From 45c86af49af38892f6f1954d04a597c6e1832dd5 Mon Sep 17 00:00:00 2001 From: Dat Date: Thu, 6 Aug 2026 10:41:58 +0200 Subject: [PATCH 7/7] fix email content --- app/Notifications/PolicyAnnouncementNotification.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/Notifications/PolicyAnnouncementNotification.php b/app/Notifications/PolicyAnnouncementNotification.php index be571b5f..01f4e69a 100644 --- a/app/Notifications/PolicyAnnouncementNotification.php +++ b/app/Notifications/PolicyAnnouncementNotification.php @@ -33,24 +33,23 @@ public function toMail($notifiable): MailMessage { ->line(new HtmlString(Lang::get('What are we talking about and why is that important?'))) ->line('') ->line(new HtmlString(Lang::get('

1. Updated Terms of Use

'))) - ->line(Lang::get('In order to comply with the European Union\'s Digital Services Act (DSA) and to build more transparency on how Wikibase Cloud works, we\'ve revised our Terms of Use. The main additions are a clear way to report illegal content, an explanation of how we handle content moderation, and a complaints-and-appeals process. These changes don\'t affect how you build or run your Wikibases.')) + ->line(new HtmlString(Lang::get('In order to comply with the European Union\'s Digital Services Act (DSA) and to build more transparency on how Wikibase Cloud works, we\'ve revised our Terms of Use. The main additions are a clear way to report illegal content, an explanation of how we handle content moderation, and a complaints-and-appeals process. These changes don\'t affect how you build or run your Wikibases.'))) ->line('') ->line(new HtmlString(Lang::get('

2. New Hosting Policy

'))) - ->line(new HtmlString(Lang::get('We\'re introducing a Hosting Policy for the first time. As a mission-driven non-profit, Wikimedia Deutschland wants Wikibase Cloud to be used purposefully and in line with our mission, that is: hosting open knowledge that serves the public and strengthens the wider Wikibase Ecosystem. The policy indicates driving factors for what the platform is for as well as the kinds of projects it\'s here to support, and lastly the basic expectations for Wikibases hosted on it.'))) + ->line(new HtmlString(Lang::get('We\'re introducing a Hosting Policy for the first time. As a mission-driven non-profit, Wikimedia Deutschland wants Wikibase Cloud to be used purposefully and in line with our mission, that is: hosting open knowledge that serves the public and strengthens the wider Wikibase Ecosystem. The policy indicates driving factors for what the platform is for as well as the kinds of projects it\'s here to support, and lastly the basic expectations for Wikibases hosted on it.'))) ->line('') - ->line(new HtmlString(Lang::get('For now, we ask you to read through the documents when you log in next, and decide whether you agree with them. We want to add that we can no longer maintain your Wikibase in case you do not agree with these changes. Read the Terms of Use and the Hosting Policy.'))) + ->line(new HtmlString(Lang::get('For now, we ask you to read through the documents when you log in next, and decide whether you agree with them. We want to add that we can no longer maintain your Wikibase in case you do not agree with these changes.'))) ->line('') ->line(Lang::get('Please note that nothing changes for your Wikibase today.')) ->line('') ->line(new HtmlString(Lang::get('

One thing to know for later

'))) ->line(Lang::get('Starting at the end of September, the Hosting Policy introduces a temporary-by-default model. To keep your Wikibase online long-term, you\'ll submit it for a short review, and you\'ll have 3 months to do so. We\'ll explain exactly how later - no Wikibase will be affected without clear notice.')) ->line('') - ->line(Lang::get('We\'d encourage you to read the Hosting Policy now and consider whether your Wikibase fits what Wikibase Cloud is for. If it\'s a good fit, the review will be straightforward. If it isn\'t, it\'s better to know early - you\'ll have time to export your data and find a new home for it by the end of the year.')) + ->line(new HtmlString(Lang::get('We\'d encourage you to read the Hosting Policy now and consider whether your Wikibase fits what Wikibase Cloud is for. If it\'s a good fit, the review will be straightforward. If it isn\'t, it\'s better to know early - you\'ll have time to export your data and find a new home for it by the end of the year.'))) ->line('') ->line(new HtmlString(Lang::get('Feel free to contact us if any of the above needs clarification on your end.'))) ->line('') ->line(Lang::get('Thanks for embarking on this journey with us!')) - ->line('') - ->line(Lang::get('The Wikibase Cloud team')); + ->line(''); } }