WebService::SendGrid::Newsletter - Perl interface to SendGrid Newsletter API
version 0.02
my $sgn = WebService::SendGrid::Newsletter->new(api_user => 'user',
api_key => 'SeCrEtKeY'
identity => 'johndoe');
# Create a new recipients list
$sgn->lists->add(list => 'subscribers', name => 'name');
# Add a recipient to the list
$sgn->lists->email->add(list => 'subscribers',
data => { name => 'Tom', email => '[email protected]' });
# Create a new newsletter
$sgn->add(identity => 'johndoe',
name => 'first newsletter',
subject => 'Your weekly newsletter',
text => 'Hello, this is your weekly newsletter',
html => '<h1>Hello</h1><p>This is your weekly newsletter</p>');
# Assign recipients list to the newsletter
$sgn->recipients->add(name => 'first newsletter', list => 'subscribers');
# Schedule the newsletter to be sent in 30 minutes
$sgn->schedule->add(name => 'first newsletter', after => 30);
Creates a new instance of WebService::SendGrid::Newsletter.
my $sgn = WebService::SendGrid::Newsletter->new(api_user => 'user',
api_key => 'SeCrEtKeY');
Parameters:
api_user
api_key
json_options
Retrieves an existing newsletter.
Parameters:
name
(Required) The name of the newsletter to retrieve.
Creates a new newsletter.
Parameters:
identity
(Required) The identity that will be assigned to this newsletter. Can be omitted if it was given as an argument when the WebService::SendGrid::Newsletter instance was created.
name
(Required) The name of the newsletter.
subject
(Required) The subject line of the newsletter.
text
(Required) The text contents of the newsletter.
html
(Required) The HTML contents of the newsletter.
Modifies an existing newsletter.
Parameters:
identity
(Required) The identity that will be assigned to this newsletter.
name
(Required) The existing name of the newsletter.
newname
(Required) The new name of the newsletter.
subject
(Required) The subject line of the newsletter.
text
(Required) The text contents of the newsletter.
html
(Required) The HTML contents of the newsletter.
Retrieves a list of all newsletters.
Parameters:
name
Newsletter name. If provided, the call checks if the specified newsletter exists.
Deletes a newsletter.
Parameters:
name
(Required) The name of the newsletter to delete.
Returns an instance of WebService::SendGrid::Newsletter::Lists, which is used to manage recipient lists.
Returns an instance of WebService::SendGrid::Newsletter::Recipients, which allows to assign recipient lists to newsletters.
Returns an instance of WebService::SendGrid::Newsletter::Schedule, which is used to schedule a delivery time for a newsletter.
Returns an instance of WebService::SendGrid::Newsletter::Identity, which is used to manipulate address of sender.
Returns an instance of WebService::SendGrid::Newsletter::Categories, which creates and manages categories within newsletters
Returns the code of the last response from the API.
Returns the data structure retrieved with the last response from the API.
Please report any bugs or feature requests through the issue tracker at https://github.com/Sidnet/p5-WebService-SendGrid-Newsletter/issues. You will be notified automatically of any progress on your issue.
This is open source software. The code repository is available for public review and contribution under the terms of the license.
https://github.com/Sidnet/p5-WebService-SendGrid-Newsletter
git clone https://github.com/Sidnet/p5-WebService-SendGrid-Newsletter.git
Michal Wojciechowski <[email protected]>
Michal Wojciechowski <[email protected]>
Michał Wojciechowski <[email protected]>
Pattawan Kaewduangdee <[email protected]>
Pattawan Kaewduangdee <[email protected]>
oiami <[email protected]>
This software is copyright (c) 2012 by Michal Wojciechowski.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.