Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 60c8074

Browse files
Method to get all messages from the inbox.
1 parent 098d2f3 commit 60c8074

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

‎src/Mailtrap.php‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function receiveAnEmail($params)
110110
*
111111
* @return array
112112
*/
113-
public function fetchLastMessage()
113+
public function fetchMessages()
114114
{
115115
$messages = $this->client->get("inboxes/{$this->config['inbox_id']}/messages")->getBody();
116116

@@ -120,6 +120,18 @@ public function fetchLastMessage()
120120

121121
$messages = json_decode($messages, true);
122122

123+
return $messages;
124+
}
125+
126+
/**
127+
* Get the most recent message of the default inbox.
128+
*
129+
* @return array
130+
*/
131+
public function fetchLastMessage()
132+
{
133+
$messages = $this->fetchMessages();
134+
123135
return array_shift($messages);
124136
}
125137

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /