Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving an odd error on run of script #133

Closed
orawalters opened this issue Mar 11, 2015 · 1 comment
Closed

Receiving an odd error on run of script #133

orawalters opened this issue Mar 11, 2015 · 1 comment

Comments

@orawalters
Copy link

I've put in the code according to the documentation the only thing I did was ad templating. Can anyone see what's wrong?

    <?php
    error_reporting(E_ALL);
    ini_set("display_errors", 1);
    date_default_timezone_set('EST');
    # Include the API
    require 'vendor/autoload.php';
    require 'lib/SendGrid.php';
    require 'html2text.php';
    # Instantiate the client.
    $sendgrid = new SendGrid('...', '...', array("turn_off_ssl_verification" => true));
    $html = $_POST["message"];
    $text = convert_html_to_text($html);
    $date = date('l, F jS ');
    # Make the call to the client.
    $email = new SendGrid\Email();
    $email
        ->addTo('...')
       # ->addTo('...') uncomment on final script
        ->setFrom('...')
        ->setSubject('New reminder for ' . $date)
        ->setText($text)
        ->setHtml($html)
        ->addFilter("templates", "enabled", 1)
        ->addFilter("templates", "template_id", "a874a34a-a9b7-460b-a5ae-7226e68da0f1")
    ;
    print '<h1>Sent successfully</h1>';
    ?>


Fatal error: Class 'SendGrid\Email' not found in /home/[...]/public_html/[...]/sendgrid.php on line 29
@eddiezane
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants