From 532bb3e096ed475b0c5426169749f84a55f4e327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Tue, 17 Jun 2025 10:51:38 +0200 Subject: [PATCH] Fix FLEXIAPI-330 Remove the ConfirmedRegistration email and related code --- CHANGELOG.md | 1 + RELEASE.md | 1 - .../Spaces/ImportConfigurationFromDotEnv.php | 1 - .../Account/PasswordController.php | 7 --- .../Controllers/Admin/SpaceController.php | 1 - .../Api/Account/PasswordController.php | 7 --- .../Controllers/Api/Admin/SpaceController.php | 2 - flexiapi/app/Mail/ConfirmedRegistration.php | 53 ------------------- flexiapi/app/Space.php | 1 - ...te_confirmed_registration_spaces_table.php | 22 ++++++++ .../views/admin/space/configuration.blade.php | 7 --- .../api/documentation_markdown.blade.php | 2 - .../mails/confirmed_registration.blade.php | 26 --------- 13 files changed, 23 insertions(+), 108 deletions(-) delete mode 100644 flexiapi/app/Mail/ConfirmedRegistration.php create mode 100644 flexiapi/database/migrations/2025_06_17_084427_delete_confirmed_registration_spaces_table.php delete mode 100644 flexiapi/resources/views/mails/confirmed_registration.blade.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 4918cf7..b0aac39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ v2.0 - Fix FLEXIAPI-325 Add endpoints to send the password reset and provisioning emails - Fix FLEXIAPI-332 Check if the first line was untouched and that the number of columns is exact on each lines - Fix FLEXIAPI-329 Use correct routes for accounts devices +- Fix FLEXIAPI-330 Remove the ConfirmedRegistration email and related code v1.6 ---- diff --git a/RELEASE.md b/RELEASE.md index f42fb91..7c8af26 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -20,7 +20,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). - INSTANCE_COPYRIGHT - INSTANCE_INTRO_REGISTRATION - INSTANCE_CUSTOM_THEME - - INSTANCE_CONFIRMED_REGISTRATION_TEXT - WEB_PANEL - PUBLIC_REGISTRATION - PHONE_AUTHENTICATION diff --git a/flexiapi/app/Console/Commands/Spaces/ImportConfigurationFromDotEnv.php b/flexiapi/app/Console/Commands/Spaces/ImportConfigurationFromDotEnv.php index 31d78d0..17d0206 100644 --- a/flexiapi/app/Console/Commands/Spaces/ImportConfigurationFromDotEnv.php +++ b/flexiapi/app/Console/Commands/Spaces/ImportConfigurationFromDotEnv.php @@ -30,7 +30,6 @@ class ImportConfigurationFromDotEnv extends Command $space->copyright_text = env('INSTANCE_COPYRIGHT', null); $space->intro_registration_text = env('INSTANCE_INTRO_REGISTRATION', null); - $space->confirmed_registration_text = env('INSTANCE_CONFIRMED_REGISTRATION_TEXT', null); $space->newsletter_registration_address = env('NEWSLETTER_REGISTRATION_ADDRESS', null); $space->account_proxy_registrar_address = env('ACCOUNT_PROXY_REGISTRAR_ADDRESS', 'sip.domain.com'); $space->account_realm = env('ACCOUNT_REALM', null); diff --git a/flexiapi/app/Http/Controllers/Account/PasswordController.php b/flexiapi/app/Http/Controllers/Account/PasswordController.php index 506cf05..63f6081 100644 --- a/flexiapi/app/Http/Controllers/Account/PasswordController.php +++ b/flexiapi/app/Http/Controllers/Account/PasswordController.php @@ -21,11 +21,8 @@ namespace App\Http\Controllers\Account; use App\Http\Controllers\Controller; use Illuminate\Http\Request; -use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Log; -use App\Mail\ConfirmedRegistration; - class PasswordController extends Controller { public function show(Request $request) @@ -55,10 +52,6 @@ class PasswordController extends Controller Log::channel('events')->info('Web: Password set for the first time', ['id' => $account->identifier]); - if (!empty($account->email)) { - Mail::to($account)->send(new ConfirmedRegistration($account)); - } - return redirect()->route('account.dashboard'); } } diff --git a/flexiapi/app/Http/Controllers/Admin/SpaceController.php b/flexiapi/app/Http/Controllers/Admin/SpaceController.php index 3dde6d7..c985293 100644 --- a/flexiapi/app/Http/Controllers/Admin/SpaceController.php +++ b/flexiapi/app/Http/Controllers/Admin/SpaceController.php @@ -162,7 +162,6 @@ class SpaceController extends Controller $space->copyright_text = $request->get('copyright_text'); $space->intro_registration_text = $request->get('intro_registration_text'); - $space->confirmed_registration_text = $request->get('confirmed_registration_text'); $space->newsletter_registration_address = $request->get('newsletter_registration_address'); $space->account_proxy_registrar_address = $request->get('account_proxy_registrar_address'); diff --git a/flexiapi/app/Http/Controllers/Api/Account/PasswordController.php b/flexiapi/app/Http/Controllers/Api/Account/PasswordController.php index da299f0..a5fc16c 100644 --- a/flexiapi/app/Http/Controllers/Api/Account/PasswordController.php +++ b/flexiapi/app/Http/Controllers/Api/Account/PasswordController.php @@ -20,14 +20,11 @@ namespace App\Http\Controllers\Api\Account; use Illuminate\Http\Request; -use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Log; use App\Http\Controllers\Controller; use App\Rules\PasswordAlgorithm; -use App\Mail\ConfirmedRegistration; - class PasswordController extends Controller { public function update(Request $request) @@ -63,9 +60,5 @@ class PasswordController extends Controller } $account->updatePassword($request->get('password'), $algorithm); - - if (!empty($account->email)) { - Mail::to($account)->send(new ConfirmedRegistration($account)); - } } } diff --git a/flexiapi/app/Http/Controllers/Api/Admin/SpaceController.php b/flexiapi/app/Http/Controllers/Api/Admin/SpaceController.php index b5491cc..3e5cc6f 100644 --- a/flexiapi/app/Http/Controllers/Api/Admin/SpaceController.php +++ b/flexiapi/app/Http/Controllers/Api/Admin/SpaceController.php @@ -66,7 +66,6 @@ class SpaceController extends Controller $space->copyright_text = $request->get('copyright_text'); $space->intro_registration_text = $request->get('intro_registration_text'); - $space->confirmed_registration_text = $request->get('confirmed_registration_text'); $space->newsletter_registration_address = $request->get('newsletter_registration_address'); $space->account_proxy_registrar_address = $request->get('account_proxy_registrar_address'); $space->account_realm = $request->get('account_realm'); @@ -149,7 +148,6 @@ class SpaceController extends Controller $space->copyright_text = $request->get('copyright_text'); $space->intro_registration_text = $request->get('intro_registration_text'); - $space->confirmed_registration_text = $request->get('confirmed_registration_text'); $space->newsletter_registration_address = $request->get('newsletter_registration_address'); $space->account_proxy_registrar_address = $request->get('account_proxy_registrar_address'); $space->account_realm = $request->get('account_realm'); diff --git a/flexiapi/app/Mail/ConfirmedRegistration.php b/flexiapi/app/Mail/ConfirmedRegistration.php deleted file mode 100644 index 7fc6120..0000000 --- a/flexiapi/app/Mail/ConfirmedRegistration.php +++ /dev/null @@ -1,53 +0,0 @@ -. -*/ - -namespace App\Mail; - -use App\Account; - -use Illuminate\Bus\Queueable; -use Illuminate\Contracts\Queue\ShouldQueue; -use Illuminate\Mail\Mailable; -use Illuminate\Mail\Mailables\Content; -use Illuminate\Mail\Mailables\Envelope; -use Illuminate\Queue\SerializesModels; - -class ConfirmedRegistration extends Mailable -{ - use Queueable, SerializesModels; - - public function __construct( - public Account $account - ) { - } - - public function envelope(): Envelope - { - return new Envelope( - subject: $this->account->space->name . ': '. __('Registration confirmed'), - ); - } - - public function content(): Content - { - return new Content( - markdown: 'mails.confirmed_registration', - ); - } -} diff --git a/flexiapi/app/Space.php b/flexiapi/app/Space.php index ede66ba..69ef1c9 100644 --- a/flexiapi/app/Space.php +++ b/flexiapi/app/Space.php @@ -43,7 +43,6 @@ class Space extends Model 'assistant_hide_third_party_account', 'copyright_text', 'intro_registration_text', - 'confirmed_registration_text', 'newsletter_registration_address', 'account_proxy_registrar_address', 'account_realm' diff --git a/flexiapi/database/migrations/2025_06_17_084427_delete_confirmed_registration_spaces_table.php b/flexiapi/database/migrations/2025_06_17_084427_delete_confirmed_registration_spaces_table.php new file mode 100644 index 0000000..c0a1b3f --- /dev/null +++ b/flexiapi/database/migrations/2025_06_17_084427_delete_confirmed_registration_spaces_table.php @@ -0,0 +1,22 @@ +dropColumn('confirmed_registration_text'); + }); + } + + public function down(): void + { + Schema::table('spaces', function (Blueprint $table) { + $table->text('confirmed_registration_text')->nullable(); + }); + } +}; diff --git a/flexiapi/resources/views/admin/space/configuration.blade.php b/flexiapi/resources/views/admin/space/configuration.blade.php index 85e989f..209769f 100644 --- a/flexiapi/resources/views/admin/space/configuration.blade.php +++ b/flexiapi/resources/views/admin/space/configuration.blade.php @@ -46,13 +46,6 @@ @include('parts.errors', ['name' => 'intro_registration_text']) -
- - - {{ __('Markdown text') }} - @include('parts.errors', ['name' => 'confirmed_registration_text']) -
-
diff --git a/flexiapi/resources/views/api/documentation_markdown.blade.php b/flexiapi/resources/views/api/documentation_markdown.blade.php index f7d5403..30c2b2e 100644 --- a/flexiapi/resources/views/api/documentation_markdown.blade.php +++ b/flexiapi/resources/views/api/documentation_markdown.blade.php @@ -162,7 +162,6 @@ JSON parameters: * `expire_at` date, the moment the space is expiring, default to `null` (never expire) * `copyright_text` text, the copyright text * `intro_registration_text` Markdown text, the main registration page text -* `confirmed_registration_text` Markdown text, the text displayed in the registration email * `newsletter_registration_address`, the newsletter registration email address * `account_proxy_registrar_address`, the account proxy registrar address * `account_realm`, the default realm for the accounts, fallback to the domain if not set @@ -199,7 +198,6 @@ JSON parameters: * `expire_at` **required**, date, the moment the space is expiring, set to `null` to never expire * `copyright_text` **required**, text, the copyright text * `intro_registration_text` **required**, Markdown text, the main registration page text -* `confirmed_registration_text` **required**, Markdown text, the text displayed in the registration email * `newsletter_registration_address`, **required**, the newsletter registration email address * `account_proxy_registrar_address`, **required**, the account proxy registrar address * `account_realm`, **required**, the default realm for the accounts, fallback to the domain if not set diff --git a/flexiapi/resources/views/mails/confirmed_registration.blade.php b/flexiapi/resources/views/mails/confirmed_registration.blade.php deleted file mode 100644 index f8d06c9..0000000 --- a/flexiapi/resources/views/mails/confirmed_registration.blade.php +++ /dev/null @@ -1,26 +0,0 @@ -@extends('mails.layout') - -@section('content') -# Welcome to {{ $account->space->name }} - -Hello {{ $account->identifier }}, - -@if ($account->space->confirmed_registration_text) -{{ strip_tags(parsedown($account->space->confirmed_registration_text)) }} -@else -Your SIP account has been successfully created. - -You can now configure this account on any SIP-compatible application using the following parameters: -@endif - -* SIP address: sip:{{ $account->identifier }} -* Username: {{ $account->username }} -* Domain: {{ $account->domain }} -@if (!empty($account->space->account_proxy_registrar_address)) -* Proxy/registrar address: sip:{{ $account->space->account_proxy_registrar_address }} -@endif -@if (!empty(config('app.transport_protocol_text'))) -* Transport: {{ config('app.transport_protocol_text') }} -@endif - -@endsection