2012-10-25 13:31:31 -04:00
|
|
|
#!/usr/bin/python
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
import optparse
|
|
|
|
|
|
|
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
|
|
|
import api.common
|
2012-11-06 14:29:40 -05:00
|
|
|
prod_client = api.common.HumbugAPI(email="feedback@humbughq.com",
|
|
|
|
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
|
|
verbose=True,
|
|
|
|
site="https://humbughq.com")
|
|
|
|
staging_client = api.common.HumbugAPI(email="feedback@humbughq.com",
|
|
|
|
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
|
|
verbose=True,
|
|
|
|
site="https://staging.humbughq.com")
|
2012-10-25 13:31:31 -04:00
|
|
|
|
|
|
|
def forward_message(message):
|
2012-11-06 15:17:53 -05:00
|
|
|
if message["type"] != "personal":
|
|
|
|
return
|
2012-10-26 10:42:31 -04:00
|
|
|
forwarded_message = {
|
|
|
|
"type": "stream",
|
2012-11-14 17:21:46 -05:00
|
|
|
"to": "support",
|
2012-10-26 10:42:31 -04:00
|
|
|
"subject": "feedback from %s" % message["sender_email"],
|
|
|
|
"content": message["content"],
|
|
|
|
}
|
2012-11-06 14:29:40 -05:00
|
|
|
staging_client.send_message(forwarded_message)
|
2012-10-25 13:31:31 -04:00
|
|
|
|
2012-11-06 14:29:40 -05:00
|
|
|
prod_client.call_on_each_message(forward_message)
|