2012-10-25 13:31:31 -04:00
|
|
|
#!/usr/bin/python
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
import optparse
|
2012-12-03 12:23:06 -05:00
|
|
|
from os import path
|
2012-10-25 13:31:31 -04:00
|
|
|
|
2012-12-03 12:23:06 -05:00
|
|
|
sys.path.append(path.join(path.dirname(__file__), '..'))
|
|
|
|
import humbug
|
|
|
|
prod_client = humbug.HumbugAPI(
|
|
|
|
email="feedback@humbughq.com",
|
|
|
|
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
|
|
verbose=True,
|
|
|
|
site="https://humbughq.com")
|
|
|
|
staging_client = humbug.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)
|