assertMailTemplate example

public function testCreationTimestamp(): void
    {
        $migration = new Migration1690874168FixPaymentStatusUnconfirmedMail();
        static::assertSame(1690874168, $migration->getCreationTimestamp());
    }

    public function testMigration(): void
    {
        $migration = new Migration1690874168FixPaymentStatusUnconfirmedMail();
        $migration->update($this->connection);
        $migration->update($this->connection);
        $this->assertMailTemplate();
    }

    public function assertMailTemplate(): void
    {
        $languageId = $this->connection->fetchOne('SELECT Hex(id) FROM `language` WHERE name = :name', ['name' => 'Deutsch']);
        $templateTypeId = $this->connection->fetchOne('SELECT Hex(id) FROM `mail_template_type` WHERE technical_name = :name', ['name' => Migration1688106315AddMissingTransactionMailTemplates::UNCONFIRMED_TYPE]);
        $templateId = $this->connection->fetchOne('SELECT Hex(id) FROM `mail_template` WHERE mail_template_type_id = :id', ['id' => Uuid::fromHexToBytes($templateTypeId)]);

        $templateSubject = $this->connection->fetchOne('SELECT subject FROM `mail_template_translation` WHERE `mail_template_id` = :mailTemplateId AND language_id = :languageId', ['mailTemplateId' => Uuid::fromHexToBytes($templateId), 'languageId' => Uuid::fromHexToBytes($languageId)]);
        static::assertEquals('Ihre Bestellung bei {{ salesChannel.name }} ist unbestÃĪtigt', $templateSubject);

        
Home | Imprint | This part of the site doesn't use cookies.