Skip to content

Commit

Permalink
Add example of how to fetch an emailmessage
Browse files Browse the repository at this point in the history
  • Loading branch information
Xethron committed May 28, 2021
1 parent d3bf3d0 commit 304c0da
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/emailmessages-view.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

require_once(__DIR__ . '/../autoload.php');

$messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here.

try {
$emailMessageResult = $messageBird->emailmessages->read('ca0a8220453bc36ddeb3115a37400870'); // Set a message id here
var_dump($emailMessageResult);
} catch (\MessageBird\Exceptions\AuthenticateException $e) {
// That means that your accessKey is unknown
echo 'wrong login';
} catch (\Exception $e) {
var_dump($e->getMessage());
}

0 comments on commit 304c0da

Please sign in to comment.