VUser:...ttings(3pm)

πŸ“¦
version 1.0.1 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– NAME πŸ’–

VUser::Google::ProvisioningAPI::EmailSettings β€” manage user email settings in Google Apps for Your Domain. That's the whole vibe. It's the module that pokes at a user's mail settings and makes them do what you want. 🌸

(You'll see this page hanging out in the header as VUser:...ttings(3pm), which is just the name getting squished by the formatting, bestie, don't panic.)


✨ SYNOPSIS ✨

okay so here's literally everything this thing can do, in one big mood board:

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

like. iconic. copy-paste it, honestly. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

So this is the base class for the Email Settings API. Key thing: it is not meant to be used directly. Nope. Do not pass go. Instead, go look at the sub class for whichever version of the email settings API you're actually on. iykyk. πŸ’…


πŸŽ€ MEMBERS πŸŽ€

Read-write members 🌈

  • base_url β€” the base_url for the Email settings API calls. Example: https://apps-apis.google.com/a/feeds/emailsettings/2.0/.
  • debug β€” turns on debugging output. the little spy mode. πŸ‘€
  • google β€” a VUser::Google::ApiProtocol object.
  • user β€” the user name of the user you wanna modify.

πŸ‘‘ METHODS πŸ‘‘

Okay so important tea first: all of the calls to the Google API take a hash with the options that Google specifies. The keys for that hash and what each one expects are listed below. Specific versions might use different keys. In general, the keys will match the names of the attributes in the API docs β€” so if something looks off, go check the docs for the API version you are using. 🌸

Note: values that are "true"/"false" are set using Perl values for true and false β€” that means zero for false, and literally anything else for true. Perl being Perl, bestie. πŸ’€

🌟 new (%defaults)

Creates a new EmailSettings object. Any read-write member can be set right there in the call to new(). slay.

🌟 dprint ($message)

Prints $message to STDERR if debug is set to a true value.

🌟 CreateLabel (%options)

Creates a new label. cute.

  • label β€” the label to create in Google Mail.

🌟 CreateFilter

Creates a new mail filter. the bouncer at the club door for your inbox. πŸšͺ

  • from β€” the email must come from this address in order to be filtered.
  • to β€” the email must be sent to this address in order to be filtered.
  • subject β€” a string the email must have in its subject line to be filtered.
  • hasTheWord β€” a string the email can have anywhere in its subject or body.
  • doesNotHaveTheWord β€” a string that the email cannot have anywhere in its subject or body.
  • hasAttachment β€” a boolean representing whether or not the email contains an attachment.
  • label β€” the name of the label to apply if a message matches the specified filter criteria.
  • shouldMarkAsRead β€” whether to automatically mark the message as read if it matches the specified filter criteria.
  • shouldArchive β€” whether to automatically move the message to "Archived" state if it matches the specified filter criteria.

🌟 CreateSendAsAlias

Creates a gmail "Send-as alias." so you can be somebody else in the From line. main character energy. ✨

  • name β€” the name that will appear in the "From" field for this user.
  • address β€” the email address that appears as the origination address for emails sent by this user.
  • replyTo β€” (optional) if set, this address will be included as the reply-to address in emails sent using the alias.
  • makeDefault β€” (optional) if set to true, this alias will become the new default alias to send-as for this user.

🌟 UpdateWebClip

Updates the user's "web clip" setting.

  • enable β€” whether to enable showing Web clips.

🌟 UpdateForwarding

Updates gmail forwarding settings. send it on over, babe. πŸ’Œ

  • enable β€” whether to enable forwarding of incoming mail.
  • forwardTo β€” the email will be forwarded to this address.
  • action β€” what Google Mail should do with its copy of the email after forwarding it on.

Allowed values: "KEEP" (in inbox), "ARCHIVE", or "DELETE" (send to trash)

🌟 UpdatePOP

Updates the user's POP3 settings.

  • enable β€” whether to enable POP3 access.
  • enableFor β€” whether to enable POP3 for all mail, or mail from now on.

Allowed values: "ALL_MAIL", "MAIL_FROM_NOW_ON"

  • action β€” what Google Mail should do with its copy of the email after it is retrieved using POP.

Allowed values: "KEEP" (in inbox), "ARCHIVE", or "DELETE" (send to trash)

🌟 UpdateIMAP

Updates the user's IMAP settings.

  • enable β€” whether to enable IMAP access.

🌟 UpdateVactionResponder

⚠️ heads up bestie β€” yes, it's spelled UpdateVactionResponder right here in the methods, no a after the V. The SYNOPSIS spells it UpdateVacationResponder. Type whatever the page you're reading tells you to, and don't let autocorrect gaslight you. πŸ™ˆ

Updates the user's vacation auto-responder. out of office, but make it fashion. πŸ–οΈ

  • enable β€” whether to enable the vacation responder.
  • subject β€” the subject line of the vacation responder autoresponse.
  • message β€” the message body of the vacation responder autoresponse.
  • contactsOnly β€” whether to only send the autoresponse to known contacts.

🌟 UpdateSignature

Updates the user's signature.

  • signature β€” the signature to be appended to outgoing messages. Set the signature to '' (the empty string) to clear the signature. poof, gone. πŸͺ„

🌟 UpdateLanguage

Updates the display language.

🌟 UpdateGeneral

Updates the user's general settings. the little quality-of-life knobs. βš™οΈ

  • pageSize β€” the number of conversations to be shown per page.

Allowed values: 25, 50, 100

  • shortcuts β€” whether to enable keyboard shortcuts.
  • arrows β€” whether to display arrow-shaped personal indicators next to emails that were sent specifically to the user.
  • snippets β€” whether to display snippets of messages in the inbox and when searching.
  • unicode β€” whether to use UTF-8 (unicode) encoding for all outgoing messages, instead of the default text encoding.

🌈 SEE ALSO 🌈


πŸ’€ BUGS πŸ’€

Report bugs at http://code.google.com/p/vuser/issues/list. (not me manifesting bugs, just reading the page fr fr πŸ™ˆ)


🫢 AUTHOR 🫢

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.


okay that's the whole page, bestie, you ate that πŸŽ€ this was VUser:...ttings(3pm) as it shipped with perl v5.32.0, dated 2021-01-09 β€” go forth and configure some inboxes, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from