class UsersDrafts extends Resource (View source)

The "drafts" collection of methods.

Typical usage is:

 $gmailService = new Google\Service\Gmail(...);
 $drafts = $gmailService->users_drafts;

Methods

create(string $userId, Draft $postBody, array $optParams = [])

Creates a new draft with the DRAFT label. (drafts.create)

delete(string $userId, string $id, array $optParams = [])

Immediately and permanently deletes the specified draft. Does not simply trash it. (drafts.delete)

get(string $userId, string $id, array $optParams = [])

Gets the specified draft. (drafts.get)

listUsersDrafts(string $userId, array $optParams = [])

Lists the drafts in the user's mailbox. (drafts.listUsersDrafts)

send(string $userId, Draft $postBody, array $optParams = [])

Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers. (drafts.send)

update(string $userId, string $id, Draft $postBody, array $optParams = [])

Replaces a draft's content. (drafts.update)

Details

Draft create(string $userId, Draft $postBody, array $optParams = [])

Creates a new draft with the DRAFT label. (drafts.create)

Parameters

string $userId

The user's email address. The special value me can be used to indicate the authenticated user.

Draft $postBody
array $optParams

Optional parameters.

Return Value

Draft

Exceptions

Exception

delete(string $userId, string $id, array $optParams = [])

Immediately and permanently deletes the specified draft. Does not simply trash it. (drafts.delete)

Parameters

string $userId

The user's email address. The special value me can be used to indicate the authenticated user.

string $id

The ID of the draft to delete.

array $optParams

Optional parameters.

Exceptions

Exception

Draft get(string $userId, string $id, array $optParams = [])

Gets the specified draft. (drafts.get)

Parameters

string $userId

The user's email address. The special value me can be used to indicate the authenticated user.

string $id

The ID of the draft to retrieve.

array $optParams

Optional parameters.

Return Value

Draft

Exceptions

Exception

ListDraftsResponse listUsersDrafts(string $userId, array $optParams = [])

Lists the drafts in the user's mailbox. (drafts.listUsersDrafts)

Parameters

string $userId

The user's email address. The special value me can be used to indicate the authenticated user.

array $optParams

Optional parameters.

Return Value

ListDraftsResponse

Exceptions

Exception

Message send(string $userId, Draft $postBody, array $optParams = [])

Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers. (drafts.send)

Parameters

string $userId

The user's email address. The special value me can be used to indicate the authenticated user.

Draft $postBody
array $optParams

Optional parameters.

Return Value

Message

Exceptions

Exception

Draft update(string $userId, string $id, Draft $postBody, array $optParams = [])

Replaces a draft's content. (drafts.update)

Parameters

string $userId

The user's email address. The special value me can be used to indicate the authenticated user.

string $id

The ID of the draft to update.

Draft $postBody
array $optParams

Optional parameters.

Return Value

Draft

Exceptions

Exception