CodeIgniter-SendGrid-Mail is a CodeIgniter wrapper for the SendGrid Mail API.
- PHP 5.1+
- CodeIgniter 2.0.0+
- cURL
- CodeIgniter REST Client Library: http://getsparks.org/packages/restclient/show
Initialization
initialize()
- Set up the library with API credentials and settings
send()
- Send an email
Errors
error_message()
- Get error message
// Load the SendGrid spark
$this->load->spark('sendgrid-mail/0.1.2');
// Initialize (not necessary if set in config)
$this->sendgrid_mail->initialize(array('api_user' => 'my_username',
'api_key' => 'secret_key',
'api_format' => 'json'));
// Send email
$result = $this->sendgrid_mail->send('[email protected]', 'Welcome to Oz!', 'You may see the wizard now.', NULL, '[email protected]');