Package com.grandst.sendgrid.bean

Examples of com.grandst.sendgrid.bean.GridResponse


      nvps.add(new BasicNameValuePair("api_key", sg.getApiKey()));
      post.setEntity(new UrlEncodedFormEntity(nvps));
      HttpResponse resp = client.execute(post);   
      String respTxt = EntityUtils.toString(resp.getEntity());
      Gson g = new Gson();
      GridResponse gr = g.fromJson(respTxt, GridResponse.class);
      if (gr.getMessage() != null && !gr.getMessage().equals("") && gr.getMessage().equals("success"))
        return true; //nailed it
      return false;
    } finally {
      client.getConnectionManager().shutdown();
    }
View Full Code Here


      nvps.add(new BasicNameValuePair("api_key", sg.getApiKey()));
      post.setEntity(new UrlEncodedFormEntity(nvps));
      HttpResponse resp = client.execute(post);   
      String respTxt = EntityUtils.toString(resp.getEntity());
      Gson g = new Gson();
      GridResponse gr = g.fromJson(respTxt, GridResponse.class);
      if (gr.getMessage() != null && !gr.getMessage().equals("") && gr.getMessage().equals("success"))
        return true; //nailed it
      return false;
    } finally {
      client.getConnectionManager().shutdown();
    }
View Full Code Here

      nvps.add(new BasicNameValuePair("api_key", sg.getApiKey()));
      post.setEntity(new UrlEncodedFormEntity(nvps));
      HttpResponse resp = client.execute(post);   
      String respTxt = EntityUtils.toString(resp.getEntity());
      Gson g = new Gson();
      GridResponse gr = g.fromJson(respTxt, GridResponse.class);
      if (gr.getMessage() != null && !gr.getMessage().equals("") && gr.getMessage().equals("success"))
        return true; //nailed it
      return false;
    } finally {
      client.getConnectionManager().shutdown();
    }
View Full Code Here

public final class SendGridMailer {

  public static GridResponse send(GridEmail email, SendGrid sg) throws ClientProtocolException, IOException {
    if (!email.validate() || !sg.validate())
      return new GridResponse(false, "");
    HttpClient client = new DefaultHttpClient();
    try {
      HttpPost post = new HttpPost(SendGrid.SENDGRID_BASE_API_URL + "mail.send.json");
      List<NameValuePair> nvps = new ArrayList<NameValuePair>();
     
View Full Code Here

TOP

Related Classes of com.grandst.sendgrid.bean.GridResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.