VUser::Google::EmailSettings(3pm) | User Contributed Perl Documentation | VUser::Google::EmailSettings(3pm) |
VUser::Google::ProvisioningAPI::EmailSettings - Manage user email settings in Google Apps for Your Domain.
use VUser::Google::ApiProtocol::V2_0; use VUser::Google::EmailSettings::V2_0; ## Create a new connection my $google = VUser::Google::ApiProtocol::V2_0->new( domain => 'your.google-apps-domain.com', admin => 'admin_user', password => 'admin_user password', ); my $settings = VUser::Google::EmailSettings::V2_0->new( google => $google, user => 'username', ); ## Create a new label $settings->CreateLabel('label' => 'newLabel'); ## Create a new filter $settings->CreateFilter( 'from' => 'sender@example.com', 'label' => 'newLabel', 'shouldArchive' => 1, ); ## Create a new send-as alias $settings->CreateSendAsAlias( 'name' => 'Tech Support', 'address' => 'support@example.com', ); ## Update the user's web clip setting $settings->UpdateWebClip('enable' => 0); # Turn off $settings->UpdateWebClip('enable' => 1); # Turn on ## Update forwarding $settings->UpdateForwarding( 'enable' => 1, 'forwardTo' => 'someoneelse@example.com', 'action' => 'KEEP', ); ## Update POP3 settings $settings->UpdatePOP( 'enable' => 1, 'enableFor' => 'MAIL_FROM_NOW_ON', 'action' => 'KEEP', ); ## Update IMAP settings $settings->UpdateIMAP('enable' => 1); ## Update user's vacation message $settings->UpdateVacationResponder( 'enable' => 1, 'subject' => "I'm not here right now", 'message' => "I've lost my mind and have gone to search for it.", 'contactsOnly' => 1, ); ## Update the user's signature $settings->UpdateSignature( 'signature' => 'Joe Cool 555-5555' ); $settings->UpdateSignature('signature' => ''); # clear sig ## Update the display language $settings->UpdateLanguage('language' => 'en-US'); ## Update the user's general settings $settings->UpdateGeneral('pageSize' => 50); # You can set more than one at a time $settings->UpdateGeneral( 'arrows' => 1, 'shortcuts' => 0, );
This is the base class for the Email Settings API. It is not meant to be used directly. Instead see the sub class for each version of the email settings API.
All of the calls to the Google API take a hash with the options specified by Google. The keys for the hash and what is expected are listed below. Specific versions my use different keys. In general, the keys will match the names of the attributes in the API docs. See the docs for the API version you are using for any differences.
Note: Values that are "true"/"false" are set using Perl values for true and false, i.e. zero for false and anything else for true.
Create a new EmailSettings object. Any read-write member may be set in the call to "new()".
Prints $message to STDERR if "debug" is set to a true value.
Create a new label.
Create a new mail filter.
Create a gmail "Send-as alias."
Update the user's "web clip" setting.
Update gmail forwarding settings.
Update the user's POP3 settings.
Allowed values: "ALL_MAIL", "MAIL_FROM_NOW_ON"
Allowed values: "KEEP" (in inbox), "ARCHIVE", or "DELETE" (send to trash)
Update the user's IMAP settings.
Update the user's vacation auto-responder.
Update the user's signature.
Update the display language.
Update the user's general settings.
Allowed values: 25, 50, 100
VUser::Google::EmailSettings::V2_0, VUser::Google::ApiProtocol
Report bugs at http://code.google.com/p/vuser/issues/list.
Randy Smith, perlstalker at vuser dot net
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.
If you make useful modification, kindly consider emailing then to me for inclusion in a future version of this module.
2021-01-09 | perl v5.32.0 |