You need to sign in to do that
Don't have an account?
Keith Stephens 18
SendGrid with Salesforce
Hello All,
I think I need to code your own HTTP Post Request, formatted as JSON.
In order to call SendGrids email API's from my Salesforce Class, but I do not know how to do this.
Can anyone help me with the code that will do this? I think it would be something similar to this:
Keith.
I think I need to code your own HTTP Post Request, formatted as JSON.
In order to call SendGrids email API's from my Salesforce Class, but I do not know how to do this.
Can anyone help me with the code that will do this? I think it would be something similar to this:
string strUsername = 'testusername'; string strPwd = 'testpwd'; Http m_http = new Http(); HttpRequest req = new HttpRequest(); req.setEndpoint('"https://api.sendgrid.com/v3/mail/send'); req.setHeader('Content-Type: application/json'); req.setHeader('Authorization: Bearer SendGridAPIKEY'); req.setMethod('POST'); req.setBody(content); httpResponse response = m_http.send(req);Thanks,
Keith.
Thanks everyone.
All Answers
Refer this link
https://github.com/sendgrid/sendgrid-apex
I have that github project installed in my SF sandbox but it gives me errors and is not working, and no reply from the author or from another post I have in this forum. So that is why I am trying to use SendGrids API, and trying to create my own HTTP Post.
So with you example how does this fit in with SendGrid, how to I get my TO:, and FROM email address and the email text which is the body.
Thanks
Keith.
Thanks everyone.