NAME
Google::RestApi::GmailApi1::Draft - Draft object for Gmail.
SYNOPSIS
# Create a draft
my $draft = $gmail_api->draft()->create(
to => 'recipient@example.com',
subject => 'Draft subject',
body => 'Draft body',
);
# Get draft details
my $details = $draft->get();
# Update draft
$draft->update(
to => 'recipient@example.com',
subject => 'Updated subject',
body => 'Updated body',
);
# Send draft
$draft->send();
# Delete draft
$draft->delete();
DESCRIPTION
Represents a Gmail draft. Supports creating, reading, updating, sending, and deleting drafts.
METHODS
create(to => $to, subject => $subject, body => $body, ...)
Creates a new draft. Required parameters: to, subject, body.
Optional parameters: from, cc, bcc, content_type.
create_raw(raw => $base64url)
Creates a draft from a pre-encoded raw MIME message.
get(format => $format, fields => $fields)
Gets draft details. Requires draft ID.
update(to => $to, subject => $subject, body => $body, ...)
Updates the draft content. Requires draft ID.
send()
Sends the draft. Requires draft ID.
delete()
Deletes the draft. Requires draft ID.
draft_id()
Returns the draft ID.
gmail_api()
Returns the parent GmailApi1 object.
AUTHORS
Robin Murray mvsjes@cpan.org
COPYRIGHT
Copyright (c) 2019-2026 Robin Murray. All rights reserved.
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.