Skip to content

Sidnet/p5-WebService-SendGrid-Newsletter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

WebService::SendGrid::Newsletter - Perl interface to SendGrid Newsletter API

VERSION

version 0.02

SYNOPSIS

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);

METHODS

new

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

get

Retrieves an existing newsletter.

Parameters:

  • name

    (Required) The name of the newsletter to retrieve.

add

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.

edit

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.

list

Retrieves a list of all newsletters.

Parameters:

  • name

    Newsletter name. If provided, the call checks if the specified newsletter exists.

delete

Deletes a newsletter.

Parameters:

  • name

    (Required) The name of the newsletter to delete.

lists

Returns an instance of WebService::SendGrid::Newsletter::Lists, which is used to manage recipient lists.

recipients

Returns an instance of WebService::SendGrid::Newsletter::Recipients, which allows to assign recipient lists to newsletters.

schedule

Returns an instance of WebService::SendGrid::Newsletter::Schedule, which is used to schedule a delivery time for a newsletter.

identity

Returns an instance of WebService::SendGrid::Newsletter::Identity, which is used to manipulate address of sender.

categories

Returns an instance of WebService::SendGrid::Newsletter::Categories, which creates and manages categories within newsletters

last_response_code

Returns the code of the last response from the API.

last_response

Returns the data structure retrieved with the last response from the API.

SUPPORT

Bugs / Feature Requests

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.

Source Code

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

AUTHOR

Michal Wojciechowski <[email protected]>

CONTRIBUTORS

COPYRIGHT AND LICENSE

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.

About

Perl interface to SendGrid Newsletter API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages