I'm trying to integrate SendGrid into my app and it isn't working. It looked so easy in the example.
My php code is as follows:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once 'lib/SendGrid.php';
$sendgrid = new SendGrid(getenv('SENDGRID_USERNAME'),
getenv('SENDGRID_PASSWORD'));
$email = new SendGrid\Email();
$email->
setSubject('Hello')->
setText('Hello World');
$sendgrid->web->send($email);
?>
But when I load the php file, I get the following error:
Fatal error: Class 'SendGrid\Email' not found in /mnt/var/vcap.local/dea/apps/<directory removed>/app/email_test.php on line 9
Why?