REST::Google::Apps::EmailSettings - A Perl library to Google's RESTful Apps Email Settings API
use REST::Google::Apps::EmailSettings $google = REST::Google::Apps::EmailSettings->new( domain => 'company.com', username => 'admin', password => 'g00gl34pp5!' ); $google->enableForwarding( username => 'jsmith', forwardTo => 'joe@example.net' );
REST::Google::Apps::EmailSettings provides a Perl interface to Google's RESTful Apps API.
Creates a new REST::Google::Apps::EmailSettings object. A domain parameter is required.
Supplying authentication information to the constructor is optional, but needs to happen either here or with a call to the authenticate method.
Example
$google = REST::Google::Apps::EmailSettings->new( domain => 'company.com', username => 'admin', password => 'g00gl34pp5!' );
Authenticate a session.
$google->authenticate( username => 'admin', password => 'g00gl34pp5!' ) || die "Could not authenticate";
Create a new label.
$google->createLabel( username => 'jsmith', label => 'Receipts' ) || die "Could not create label";
Create a new filter.
One or more of the following parameters is required to define the criteria for the filter:
Specifies the e-mail address of the sender.
from => 'j.q.public@company.com'
Specifies the e-mail address the message was sent to.
to => 'jsmith@example.net'
Filters for a string anywhere in the e-mail's subject line.
subject => 'project'
Filters for a string anywhere in the e-mail's subject line or body.
hasWord => 'work'
Specifies that the e-mail cannot have a string anywhere in the subject or body.
noWord => 'proposal'
Can be 'true' or 'false', representing whether or not the e-mail contains an attachment
attachment => 'true'
One or more of the following parameters is required to define the action to be taken when the specified criteria has been met:
Specifies the name of the label to apply to the message. The label must already exist to be used (see the createLabel function).
label => 'Receipts'
Can be 'true' or 'false', representing whether or not to mark the message as read.
markAsRead => 'true'
Can be 'true' or 'false', representing whether or not to archive the message if the criteria is met.
archive => 'true'
Examples
$google->createFilter( username => 'jsmith', hasWord => 'receipt', label => 'Receipts' ) || die "Could not create filter"; $google->createFilter( username => 'jsmith', from => 'spam@example.net', archive => 'true' ) || die "Could not create filter";
Create a send-as alias.
Required. Specified the username of the mail account.
Required. The name that will appear in the 'from' field for this user.
Required. The e-mail address that appears as the origination address for emails sent by this user.
Optional. If set, this address will be included as the reply-to address in emails sent using the alias.
Optional. Can be 'true' or 'false', representing whether or not this alias will be become the new default alias to send-as for this user.
$google->createSendAs( username => 'jsmith', name => 'Sales', address => 'sales@company.com', default => 'true' ) || die "Could not create send-as alias";
Enable or disable web clips.
$google->enableWebClips( username => 'jsmith' );
Enable forwarding.
action is an optional parameter defining what Google should do with mail once forwarding is enabled. Valid options are 'archive', 'keep' (the default), and 'delete'.
$google->enableForwarding( username => 'jsmith', forwareTo => 'joe@example.net', action => 'archive' ) || die "Could not enable forwarding";
Disable forwarding.
$google->disableForwarding( username => 'jsmith' );
Enable POP access.
An optional parameter defining what Google should do with mail once POP access is enabled. Valid options are 'archive', 'keep' (the default), and 'delete'.
An optional parameter defining whether to enable POP for all mail, or mail from now on. Valid options are 'all', and 'now' (the default).
$google->enablePOP( username => 'jsmith', enableFor => 'all', action => 'archive' ) || die "Could not enable POP";
Disable POP access.
$google->disablePOP( username => 'jsmith' );
Enable or disable IMAP access.
$google->enableIMAP( username => 'jsmith' );
Enable a vacation/out-of-office auto-responder.
The subject line for the vacation auto-responder.
The message body of the vacation auto-responder. Up to 100 KB is allowed.
Whether to only send the autoresponse to known contacts.
$google->enableVacation( username => 'jsmith', subject => 'Out of the office', message => 'I will be out of the office until Tuesday. Please ' . 'contact me at 555-5555 for all urgent matters.' ) || die "Could not enable vacation auto-responder";
Disable a vacation auto-responder.
$google->disableVacation( username => 'jsmith' );
Enable an e-mail signature.
$google->enableSignature( username => 'jsmith', signature => 'Joey Smith - (+1) 555-555-5555' ) || die "Could not enable signature";
Disable a signature.
$google->disableSignature( username => 'jsmith' );
Updating the display language setting.
$google->setLanguage( username => 'jsmith', language => 'de' );
Set the number of conversations to be shown per page.
$google->setPageSize( username => 'jsmith', pageSize => '50' );
Enable or disable keyboard shortcuts.
$google->enableShortcuts( username => 'jsmith' );
Enable or disable arrow-shaped personal indicators ( › and » ) next to emails that were sent specifically to the user.
$google->enableArrows( username => 'jsmith' );
Enable or disable snippets of messages in the inbox and when searching.
$google->enableSnippets( username => 'jsmith' );
Scott Schneider <sschneid@gmail.com>
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in '›'. Assuming UTF-8
To install REST::Google::Apps::EmailSettings, copy and paste the appropriate command in to your terminal.
cpanm
cpanm REST::Google::Apps::EmailSettings
CPAN shell
perl -MCPAN -e shell install REST::Google::Apps::EmailSettings
For more information on module installation, please visit the detailed CPAN module installation guide.