in libs/google/gmail.py [0:0]
def set_ooo_msg(self, user_id, text):
"""
Sets a vacation responder for the user.
:param user_id: userId
:return: bool
"""
vacation_settings = {
'enableAutoReply': True,
'responseBodyHtml': text,
'restrictToDomain': False,
}
try:
r = json.loads(self.call_google_api(service=self.service,
api_resource="users.settings",
api_method="updateVacation",
response_field="enableAutoReply",
userId=user_id,
body=vacation_settings))
return r
except(ValueError, KeyError, TypeError):
return False