https://github.com/sendgrid/sendgrid-perl
Perl module for SendGrid's API
https://github.com/sendgrid/sendgrid-perl
Last synced: 5 months ago
JSON representation
Perl module for SendGrid's API
- Host: GitHub
- URL: https://github.com/sendgrid/sendgrid-perl
- Owner: sendgrid
- Created: 2013-05-07T15:34:17.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2016-04-28T06:21:58.000Z (almost 10 years ago)
- Last Synced: 2025-09-05T16:46:23.717Z (7 months ago)
- Language: Perl
- Size: 532 KB
- Stars: 18
- Watchers: 195
- Forks: 13
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
**IMPORTANT ANNOUNCEMENT**
**As of May 1, 2016, SendGrid will no longer support this library.**
Please direct any questions to the [Developer Experience](mailto:dx@sendgrid.com) team.
[](https://travis-ci.org/sendgrid/sendgrid-perl)
#sendgrid-perl
Send emails via SendGrid. Provides wrapper for custom SMTP API fields
and allows for easy manipulation of filter/app settings.
Written by Tim Jenkins.
#License
Licensed under the MIT License.
#Install
We are currently working on getting this module on CPAN. In the
meantime, you can install from the included archive.
git clone https://github.com/sendgrid/sendgrid-perl.git
cd sendgrid-perl
sudo cpanm SendGrid-1.3.tar.gz
You can also build the archive yourself:
perl Makefile.PL
make
make test
make dist
#Basic usage
For authentication, please use either your SendGrid credentials or an [API key](https://sendgrid.com/docs/User_Guide/Account/api_keys.html).
```perl
use warnings;
use strict;
use Email::SendGrid;
use Email::SendGrid::Transport::REST;
my $sg = Email::SendGrid->new( from => 'from@example.com',
to => 'to@example.com',
subject => 'Testing',
text => "Some text http://sendgrid.com/\n",
html => 'Some html
SG
' );
#disable click tracking filter for this request
$sg->disableClickTracking();
#turn on the unsubscribe filter here with custom values
$sg->enableUnsubscribe( text => "Unsubscribe here: <% %>", html => "Unsubscribe <% here %>" );
#set a category
$sg->header->setCategory('first contact');
#add unique arguments
$sg->header->addUniqueIdentifier( customer => '12345', location => 'somewhere' );
my $trans = Email::SendGrid::Transport::REST->new( username => 'sendgrid_username', password => 'sendgrid_password' );
my $error = $trans->deliver($sg);
die $error if ( $error );
```
#Advanced Usage
For more detailed information, please refer to the perldocs.