Skip to content

Conversation

@lornajane
Copy link
Contributor

I noticed that the .env-example used API_KEY rather than NEXMO_API_KEY which the code seemed to expect, so I changed it to match.

@mheap mheap self-requested a review July 18, 2018 12:03
Copy link
Contributor

@mheap mheap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's only one example that uses API_KEY and API_SECRET that needs updating too https://github.com/nexmo-community/nexmo-php-quickstart/blob/d969e243bb5a11b0ee5296bf50ba7b40212aa215/sms/send-with-slim/index.php#L13

@lornajane
Copy link
Contributor Author

lornajane commented Jul 18, 2018

Got carried away and added a readme as well. Could you take another look please?

$client = new Nexmo\Client(new Nexmo\Client\Credentials\Basic(API_KEY, API_SECRET));
$text = new \Nexmo\Message\Text($args['number'], NEXMO_FROM_NUMBER, $body['text']);
$client = new Nexmo\Client(new Nexmo\Client\Credentials\Basic(NEXMO_API_KEY, NEXMO_API_SECRET));
$text = new \Nexmo\Message\Text($args['number'], FROM, $body['text']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When config.php is included it iterates over $_ENV and defines a constant for each key. This is how NEXMO_API_KEY and NEXMO_API_SECRET have values.

Following that, FROM should be FROM_NUMBER as that's the name in .env

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's .env that wants updating then, FROM is our standard placeholder.

@lornajane
Copy link
Contributor Author

This commit changes the .env-example to use FROM, as our building blocks do. I couldn't find any other examples that used it, they mostly hardcode the from. Hopefully good to go now.

@mheap mheap merged commit 7c57f7a into master Jul 19, 2018
@mheap mheap deleted the update-example-env-vars branch July 19, 2018 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants