gmailr (version 0.7.1)

modify_message: Modify the labels on a message

Description

Function to modify the labels on a given message by id. Note you need to use the label ID as arguments to this function, not the label name.

Usage

modify_message(id, add_labels = NULL, remove_labels = NULL,
  user_id = "me")

Arguments

id

message id to access

add_labels

label IDs to add to the specified message

remove_labels

label IDs to remove from the specified message

user_id

gmail user_id to access, special value of 'me' indicates the authenticated user.

References

https://developers.google.com/gmail/api/v1/reference/users/messages/modify

See Also

Other message: attachment, delete_message, import_message, insert_message, messages, message, save_attachments, save_attachment, send_message, trash_message, untrash_message

Examples

Run this code
# NOT RUN {
modify_message(12345, add_labels='label_1')
modify_message(12345, remove_labels='label_1')
#add and remove at the same time
modify_message(12345, add_labels='label_2', remove_labels='label_1')
# }

Run the code above in your browser using DataCamp Workspace