Skip to content

Instantly share code, notes, and snippets.

@mikeyk
Created March 19, 2016 21:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeyk/117d70c0adcf3ec025c6 to your computer and use it in GitHub Desktop.
Save mikeyk/117d70c0adcf3ec025c6 to your computer and use it in GitHub Desktop.
Amazon Echo>OmniFocus email
from __future__ import print_function
import json
import boto3
ses_client = boto3.client('ses')
TARGET = "mike"
EMAILS = {
"kaitlyn": "",
"mike": "XXX@sync.omnigroup.com"
}
def send_email(to_email, task_text):
response = ses_client.send_email(
Source='XYXY@gmail.com',
Destination={
'ToAddresses': [
to_email
],
},
Message={
'Subject': {
'Data': task_text,
},
'Body': {
'Text': {
'Data': ""
}
}
}
)
def read_from_echo(event, *args, **kwargs):
slots = event["request"]["intent"]["slots"]
task_text = slots["TaskText"]["value"].capitalize()
send_email(EMAILS[TARGET], task_text)
response = {
"version": "1.0",
"sessionAttributes": {},
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "Done."
},
"shouldEndSession": True
}
}
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment