Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPF-55 Remove the blocked email #1395

Merged
merged 8 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.ci
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,6 @@ MAILJET_TEMPLATE_INTEGRATION_CREATED=1
MAILJET_TEMPLATE_INTEGRATION_BLOCKED=2
MAILJET_TEMPLATE_INTEGRATION_ACTIVATED=3
MAILJET_TEMPLATE_INTEGRATION_ACTIVATION_REMINDER=4
MAILJET_TEMPLATE_INTEGRATION_ACTIVATION_REQUEST=5
MAILJET_TEMPLATE_INTEGRATION_DELETED=6
MAILJET_SANDBOX_MODE=true
8 changes: 0 additions & 8 deletions app/Domain/Mail/MailManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use App\Domain\Integrations\Events\ActivationExpired;
use App\Domain\Integrations\Events\IntegrationActivated;
use App\Domain\Integrations\Events\IntegrationActivationRequested;
use App\Domain\Integrations\Events\IntegrationBlocked;
use App\Domain\Integrations\Events\IntegrationCreatedWithContacts;
use App\Domain\Integrations\Events\IntegrationDeleted;
use App\Domain\Integrations\Integration;
Expand Down Expand Up @@ -47,13 +46,6 @@ public function sendIntegrationActivatedMail(IntegrationActivated $event): void
$this->sendMail($integration, $this->templates->getOrFail(TemplateName::INTEGRATION_ACTIVATED->value));
}

public function sendIntegrationBlockedMail(IntegrationBlocked $event): void
{
$integration = $this->integrationRepository->getById($event->id);

$this->sendMail($integration, $this->templates->getOrFail(TemplateName::INTEGRATION_BLOCKED->value));
}

public function sendIntegrationActivationRequestMail(IntegrationActivationRequested $event): void
{
$integration = $this->integrationRepository->getById($event->id);
Expand Down
2 changes: 0 additions & 2 deletions app/Mails/MailServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use App\Domain\Integrations\Events\ActivationExpired;
use App\Domain\Integrations\Events\IntegrationActivated;
use App\Domain\Integrations\Events\IntegrationActivationRequested;
use App\Domain\Integrations\Events\IntegrationBlocked;
use App\Domain\Integrations\Events\IntegrationCreatedWithContacts;
use App\Domain\Integrations\Events\IntegrationDeleted;
use App\Domain\Integrations\Repositories\IntegrationRepository;
Expand Down Expand Up @@ -57,7 +56,6 @@ public function register(): void

Event::listen(IntegrationCreatedWithContacts::class, [MailManager::class, 'sendIntegrationCreatedMail']);
Event::listen(IntegrationActivated::class, [MailManager::class, 'sendIntegrationActivatedMail']);
Event::listen(IntegrationBlocked::class, [MailManager::class, 'sendIntegrationBlockedMail']);
Event::listen(ActivationExpired::class, [MailManager::class, 'sendActivationReminderEmail']);
Event::listen(IntegrationActivationRequested::class, [MailManager::class, 'sendIntegrationActivationRequestMail']);
Event::listen(IntegrationDeleted::class, [MailManager::class, 'sendIntegrationDeletedMail']);
Expand Down
1 change: 0 additions & 1 deletion app/Mails/Template/TemplateName.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ enum TemplateName: string
{
case INTEGRATION_CREATED = 'integration_created';
case INTEGRATION_ACTIVATION_REMINDER = 'integration_activation_reminder';
case INTEGRATION_BLOCKED = 'integration_blocked';
case INTEGRATION_ACTIVATED = 'integration_activated';
case INTEGRATION_ACTIVATION_REQUEST = 'integration_activation_request';
case INTEGRATION_DELETED = 'integration_deleted';
Expand Down
5 changes: 0 additions & 5 deletions config/mailjet.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
'enabled' => true,
'subject' => 'Welcome to Publiq platform - Let\'s get you started!',
],
TemplateName::INTEGRATION_BLOCKED->value => [
'id' => env('MAILJET_TEMPLATE_INTEGRATION_BLOCKED'),
'enabled' => false,
'subject' => 'Publiq platform - Integration blocked',
],
TemplateName::INTEGRATION_ACTIVATED->value => [
'id' => env('MAILJET_TEMPLATE_INTEGRATION_ACTIVATED'),
'enabled' => true,
Expand Down
13 changes: 0 additions & 13 deletions tests/Domain/Mail/MailManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use App\Domain\Integrations\Events\ActivationExpired;
use App\Domain\Integrations\Events\IntegrationActivated;
use App\Domain\Integrations\Events\IntegrationActivationRequested;
use App\Domain\Integrations\Events\IntegrationBlocked;
use App\Domain\Integrations\Events\IntegrationCreatedWithContacts;
use App\Domain\Integrations\Events\IntegrationDeleted;
use App\Domain\Integrations\Integration;
Expand All @@ -31,7 +30,6 @@
final class MailManagerTest extends TestCase
{
private const INTEGRATION_ID = '9e6d778f-ef44-45b3-b842-26b6d71bcad7';
private const TEMPLATE_BLOCKED_ID = 1;
private const TEMPLATE_ACTIVATED_ID = 2;
private const TEMPLATE_CREATED_ID = 3;
private const TEMPLATE_INTEGRATION_ACTIVATION_REMINDER = 4;
Expand Down Expand Up @@ -196,12 +194,6 @@ public static function mailDataProvider(): array
'templateId' => self::TEMPLATE_ACTIVATED_ID,
'subject' => 'Publiq platform - Integration activated',
],
TemplateName::INTEGRATION_BLOCKED->value => [
'event' => new IntegrationBlocked(Uuid::fromString(self::INTEGRATION_ID)),
'method' => 'sendIntegrationBlockedMail',
'templateId' => self::TEMPLATE_BLOCKED_ID,
'subject' => 'Publiq platform - Integration blocked',
],
TemplateName::INTEGRATION_ACTIVATION_REQUEST->value => [
'event' => new IntegrationActivationRequested(Uuid::fromString(self::INTEGRATION_ID)),
'method' => 'sendIntegrationActivationRequestMail',
Expand Down Expand Up @@ -233,11 +225,6 @@ private function getTemplateConfig(): array
'enabled' => true,
'subject' => 'Welcome to Publiq platform - Let\'s get you started!',
],
TemplateName::INTEGRATION_BLOCKED->value => [
'id' => self::TEMPLATE_BLOCKED_ID,
'enabled' => true,
'subject' => 'Publiq platform - Integration blocked',
],
TemplateName::INTEGRATION_ACTIVATED->value => [
'id' => self::TEMPLATE_ACTIVATED_ID,
'enabled' => true,
Expand Down
Loading