Struct sendgrid::sg_client::SGClient
[−]
[src]
pub struct SGClient { /* fields omitted */ }
This is the struct that allows you to authenticate to the SendGrid API. It's only field is the API key which allows you to send messages.
Methods
impl SGClient
[src]
fn new(key: String) -> SGClient
Makes a new SendGrid cient with the specified API key.
fn send(self, mail_info: Mail) -> SendgridResult<String>
Sends a messages through the SendGrid API. It takes a Mail struct as an argument. It returns the string response from the API as JSON. It sets the Content-Type to be application/x-www-form-urlencoded.