Help get this topic noticed by sharing it on Twitter Twitter, Facebook Facebook, or email.
Alex Duffield

PHP Wrapper or code to share?

Hey all I am new here to Send Grid. I was looking around and cant seem to find a good PHP wrapper for the API functions here.

Has any one done one? Or have any code they would be willing to share? I would be more than happy to post back my work as well for others here.

Please posts your code samples here of feel free to contact me direct.

Thanks!
2 people have
this question
+1
Reply

  • Jacob (Support Engineer) January 17, 2012 19:07
    We have a PHP implementation for our SMTP API.

    I don't know if that's a "wrapper", and I'd love to see what the community has for you, but that should get you started!
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • Alex Duffield
    Thanks. It seems odd to me that you guys DONT have a wrapper honestly seeing as your main target is developers. There is no point in every developer having to write there own code in what ever language they use.

    Take a look at Campaign Monitors API .

    Then Look at the Wrappers they provide

    Or Look at PostMark - They have 17 different wrappers! for PHP alone (built buy community)

    Simplified version of what a Wrapper would give me ...


    <?
    require_once 'SendGrid.php';

    $sg = new SendGrid('Your API Key', 'Your API Secret');

    $result = $sg->createIdentity($identity, $name, $email, $address, $city, $state, $zip, $country );

    echo "Result :\n<br />";
    if($result->was_successful()) {
    echo "Created with ID\n<br />".$result->response;
    } else {
    echo 'Failed with code '.$result->http_status_code."\n<br /><pre>";
    var_dump($result->response);
    echo '</pre>';
    }
    ?>


    Thats the general idea..
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned