Skip to content

Commit

Permalink
Renamed postmark property rawMail to rawEmail (bugfix) (#1)
Browse files Browse the repository at this point in the history
* Renamed postmark property rawMail to rawEmail (bugfix)
* Updated QA secrets configuration

Co-authored-by: alexbuis <alex@wecreatesolutions.nl>
  • Loading branch information
alexbuis and alexbuis authored Jan 5, 2023
1 parent 19d5dce commit 4aec12a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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...
3 changes: 2 additions & 1 deletion fixtures/inbound.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,6 @@
"ContentLength": 16384,
"ContentID": ""
}
]
],
"RawEmail": "TEST"
}
4 changes: 2 additions & 2 deletions src/Inbound.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Headers: array<int, InboundMessageHeader>,
* Attachments: array<int, InboundMessageAttachment>|null,
* ReplyTo: string|null,
* RawMail: string|null,
* RawEmail: string|null,
* TextBody: string,
* HtmlBody: string,
* StrippedTextReply: string|null,
Expand Down Expand Up @@ -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'] ?? '')
Expand Down
10 changes: 5 additions & 5 deletions src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Message

private DateTimeImmutable $dateTimeImmutable;

private string $rawMail;
private string $rawEmail;

private string $textBody;

Expand Down Expand Up @@ -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;
}

Expand Down
5 changes: 3 additions & 2 deletions tests/InboundTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 4aec12a

Please sign in to comment.