diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml index c04dfb4..f4bbe13 100644 --- a/.github/workflows/qa.yaml +++ b/.github/workflows/qa.yaml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v2 - name: Configure WCS Package Manager credentials - run: echo '${{ secrets.COMPOSER_AUTH_JSON_NEW }}' > auth.json + run: echo '${{ secrets.COMPOSER_AUTH_JSON }}' > auth.json - name: Composer validate run: composer validate diff --git a/CHANGELOG.md b/CHANGELOG.md index 4381f08..a251e54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,17 @@ All notable changes to `postmark-inbound` will be documented in this file. ## [Unreleased] +## [v1.0.1] - 2023-01-05 + +### Added +- Renamed rawEmail property to rawEmail. (bugfix) + ## [v1.0.0] - 2023-01-05 ### Added - Initial version of the package. -[Unreleased]: https://github.com/wecreatesolutions/postmark-inbound/compare/v1.0.0...HEAD + +[Unreleased]: https://github.com/wecreatesolutions/postmark-inbound/compare/v1.0.0...main +[v1.0.1]: https://github.com/wecreatesolutions/postmark-inbound/compare/v1.0.1...v1.0.0 [v1.0.0]: https://github.com/wecreatesolutions/postmark-inbound/compare/v1.0.0... diff --git a/fixtures/inbound.json b/fixtures/inbound.json index 0c761cb..0cea878 100644 --- a/fixtures/inbound.json +++ b/fixtures/inbound.json @@ -95,5 +95,6 @@ "ContentLength": 16384, "ContentID": "" } - ] + ], + "RawEmail": "TEST" } diff --git a/src/Inbound.php b/src/Inbound.php index 10fc69c..edf3602 100644 --- a/src/Inbound.php +++ b/src/Inbound.php @@ -21,7 +21,7 @@ * Headers: array, * Attachments: array|null, * ReplyTo: string|null, - * RawMail: string|null, + * RawEmail: string|null, * TextBody: string, * HtmlBody: string, * StrippedTextReply: string|null, @@ -103,7 +103,7 @@ public static function fromPostmarkArray(array $json): Message ->setReplyTo($json['ReplyTo'] ?? '') ->setMailboxHash($json['MailboxHash']) ->setDate($dateTimeImmutable) - ->setRawMail($json['RawMail'] ?? '') + ->setRawEmail($json['RawEmail'] ?? '') ->setTextBody($json['TextBody']) ->setHtmlBody($json['HtmlBody']) ->setStrippedTextReply($json['StrippedTextReply'] ?? '') diff --git a/src/Message.php b/src/Message.php index b0d74a5..fc988d1 100644 --- a/src/Message.php +++ b/src/Message.php @@ -18,7 +18,7 @@ class Message private DateTimeImmutable $dateTimeImmutable; - private string $rawMail; + private string $rawEmail; private string $textBody; @@ -123,14 +123,14 @@ public function setDate(DateTimeImmutable $dateTimeImmutable): Message return $this; } - public function getRawMail(): string + public function getRawEmail(): string { - return $this->rawMail; + return $this->rawEmail; } - public function setRawMail(string $rawMail): Message + public function setRawEmail(string $rawEmail): Message { - $this->rawMail = $rawMail; + $this->rawEmail = $rawEmail; return $this; } diff --git a/tests/InboundTest.php b/tests/InboundTest.php index 424ab71..53abfca 100644 --- a/tests/InboundTest.php +++ b/tests/InboundTest.php @@ -40,6 +40,7 @@ public function testJsonParseSuccessful(): void self::assertEquals('Ok, thanks for letting me know!', $message->getStrippedTextReply()); self::assertEquals('tag', $message->getTag()); self::assertEquals('myUsersReplyAddress@theirDomain.com', $message->getReplyTo()); + self::assertEquals('TEST', $message->getRawEmail()); self::assertEquals(new DateTime('Thu, 5 Apr 2012 16:59:01 +0200'), $message->getDate()); @@ -149,8 +150,8 @@ public function testSetters(): void $message->setStrippedTextReply('text'); self::assertEquals('text', $message->getStrippedTextReply()); - $message->setRawMail('raw'); - self::assertEquals('raw', $message->getRawMail()); + $message->setRawEmail('raw'); + self::assertEquals('raw', $message->getRawEmail()); $message->setHtmlBody('html'); self::assertEquals('html', $message->getHtmlBody());