sendgrid / sendgrid-php

The Official Twilio SendGrid PHP API Library
https://sendgrid.com
MIT License
1.49k stars 624 forks source link

Composer error when using Sendgrid without composer #1113

Closed warpdesign closed 4 weeks ago

warpdesign commented 4 weeks ago

Issue Summary

A summary of the issue and the environment in which it occurs. If suitable, include the steps required to reproduce the bug. Please feel free to include screenshots, screencasts, or code examples.

Steps to Reproduce

  1. Download and unpack sendgrid-php latest release from the GitHub downloads
  2. Create a file with the sample code found here
  3. Correctly modify the link to point to sendgrid-php.php from the downloaded release

Code Snippet

    require 'sendgrid-php/sendgrid-php.php';

    $email = new \SendGrid\Mail\Mail(); 
    $email->setFrom("test@example.com", "Example User");
    $email->setSubject("Sending with SendGrid is Fun");
    $email->addTo("test@example.com", "Example, User");
    $email->addContent("text/plain", "and easy to do anywhere, even with PHP");
    $email->addContent(
        "text/html", "<strong>and easy to do anywhere, even with PHP</strong>"
    );
    $sendgrid = new \SendGrid('APIKEY');
    try {
        $response = $sendgrid->send($email);
        print $response->statusCode() . "\n";
        print_r($response->headers());
        print $response->body() . "\n";
        print "mail sent";
    } catch (Exception $e) {
        echo 'Caught exception: '. $e->getMessage() ."\n";
    }   

Exception/Log

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0".

Technical details:

warpdesign commented 4 weeks ago

After reading the readme, it seems PHP 7.3 is required. I am closing this issue but the official sendgrid-php guide isn't up to date and mentions PHP 5.6 is supported: it should be updated, or at least mentions only sendgrid 7.x supports PHP 5.6.