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 f110458 commit 4c7771c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions examples/emailmessages-view.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

use MessageBird\Client;

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

$messageBird = new 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 4c7771c

Please sign in to comment.