Mail::SendGrid::SmtpApiHeader - generate SendGrid's SMTP extension header
use Mail::SendGrid::SmtpApiHeader; # Use AnyEvent as usual my $cond = AnyEvent->condvar; http_get "http://search.cpan.org/", sub { $cond->send(); }; $cond->recv();
This module generates the custom SMTP extension header used to configure SendGrid's SMTP platform.
Used to create a new instance. The constructor takes no arguments.
my $headers = Mail::SendGrid::SmtpApiHeader->new();
Adds the given email address to the list of recipients (i.e. To).
$headers->addTo( 'me@example.com', 'you@example.com', );
Specify substitution variables for multi recipient e-mails. This would allow you to, for example, substitute the string with a recipient's name. 'val' can be either a scalar or an array. It is the user's responsibility to ensure that there are an equal number of substitution values as there are recipients.
$headers->addSubVal(names => "Me", "You");
Specify any unique argument values.
$headers->setUniqueArgs( { test => 1, foo => 2, } );
Sets a category for an e-mail to be logged as. You may use any category name you like.
$header->setCategory('send-001');
Adds/changes a setting for a filter. Settings specified in the header will override configured settings.
# Enable a text footer and set it $header->addFilterSetting(footer => 'enable', 1, 'text/plain', "Thank you for your business", );
Add unique argument values to the existing unique arguments.
$headers->addUniqueArgs( test => 1, foo => 2, );
Returns the full header which can be inserted into an e-mail.
Returns the JSON version of the requested data.
Returns the JSON version of the requested data in a more human readable way.
SendGrid
Booking.com
Emmanuel Rodriguez <potyl@cpan.org>
Copyright (C) 2010 by SendGrid
Copyright (C) 2011 by Booking.com
Copyright (C) 2012 by Emmanuel Rodriguez
To install Mail::SendGrid::SmtpApiHeader, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mail::SendGrid::SmtpApiHeader
CPAN shell
perl -MCPAN -e shell install Mail::SendGrid::SmtpApiHeader
For more information on module installation, please visit the detailed CPAN module installation guide.