NAME

Net::Postage::App - Perl extension for Postageapp.com API

SYNOPSIS

use Net::Postage::App;


my $postage = Net::Postage::App->new(api_key => 'YOUR_PostageApp_API_KEY_HERE');

###next prepare your message

$postage->message(
  from => 'your_name <your_email>', ##required
  reply_to => 'no-reply@example.com',  ##optional
  subject => 'Hi This is a test message', ##subject line is required
  textmessage => 'Hi there this is a TEXT message test',
  htmlmessage => '<b>Hi there this is an HTML message test</b>'
  headers => {
      x-mailer => 'Postage-App.pm'
      ##.. you can add custom headers here
  }
);

###now add recipients

##You can add a single recipient
$postage->to('test@example.com');

##You can add an array of recipients at once
$postage->to(['test@example.com','test2@example2.com',...]);

##Or hash of recipients for variable replacement
$postage->to({
  'test@example.com' => { first_name => 'Mahmoud', last_name => 'Mehyar', ... },
  'test2@example2.com' => { first_name => 'fName', last_name => 'lName', ... },
  ...
});

##Last, do the send
$postage->send();

###make sure the sending was suucessful, otherwise send again later
if (!$postage->is_success){

  ###sending process wasn't successful, look up what was wrong
  
  ##you can access postageapp API response at $postage->{response}
  use Data::Dumper;
  print Dumper($postage->{response});

}

else {
  print "Your message sent successfully";
}

  

DESCRIPTION

Perl interface to the Postageapp.com API

postageapp.com "From their website" Outsource the sending of your application generated email, so your app can do what it does best... be awesome!

See http://postageapp.com

EXPORT

None by default.

SEE ALSO

For more information about postageapp API please visit their documentation page

http://postageapp.com/docs/api

AUTHOR

Mahmoud A Mehyar, <mamod.mehyar@gmail.com<gt>

COPYRIGHT AND LICENSE

Copyright (C) 2010 by Mahmoud A. Mehyar

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.