| Line 19... |
Line 19... |
| 19 |
import urllib2
|
19 |
import urllib2
|
| 20 |
import urlparse
|
20 |
import urlparse
|
| 21 |
from Crypto.Hash import MD5
|
21 |
from Crypto.Hash import MD5
|
| 22 |
from Crypto.Cipher import DES
|
22 |
from Crypto.Cipher import DES
|
| 23 |
import string
|
23 |
import string
|
| 24 |
from dtr.utils.MailSender import Email
|
- |
|
| 25 |
#TODO Need to add messy stuff to conf.
|
24 |
#TODO Need to add messy stuff to conf.
|
| 26 |
|
25 |
|
| 27 |
|
26 |
|
| 28 |
SENDER = "cnc.center@shop2020.in"
|
27 |
SENDER = "cnc.center@shop2020.in"
|
| 29 |
PASSWORD = "5h0p2o2o"
|
28 |
PASSWORD = "5h0p2o2o"
|
| Line 406... |
Line 405... |
| 406 |
skuData = get_mongo_connection().Catalog.MasterData.find_one({'identifier':identifier, 'source_id':storeId})
|
405 |
skuData = get_mongo_connection().Catalog.MasterData.find_one({'identifier':identifier, 'source_id':storeId})
|
| 407 |
elif storeId == 3:
|
406 |
elif storeId == 3:
|
| 408 |
skuData = get_mongo_connection().Catalog.MasterData.find_one({'secondaryIdentifier':identifier, 'source_id':storeId})
|
407 |
skuData = get_mongo_connection().Catalog.MasterData.find_one({'secondaryIdentifier':identifier, 'source_id':storeId})
|
| 409 |
return skuData
|
408 |
return skuData
|
| 410 |
|
409 |
|
| 411 |
def _sendAlertForNewApp(packageName, appName):
|
410 |
def sendCrmProjectMail(userId,disposition_description,disposition_comments):
|
| 412 |
m = Email('104.200.25.40')
|
- |
|
| 413 |
mFrom = "dtr@shop2020.in"
|
- |
|
| 414 |
m.setFrom(mFrom)
|
411 |
headers = {
|
| 415 |
#mTo = ['rajneesh.arora@saholic.com','kshitij.sood@saholic.com','chaitnaya.vats@saholic.com','manoj.kumar@saholic.com','manish.sharma@shop2020.in','yatin.singh@saholic.com']
|
412 |
'User-agent':'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36',
|
| - |
|
413 |
'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
| - |
|
414 |
'Accept-Language' : 'en-US,en;q=0.8',
|
| 416 |
mTo = ['manas.kapoor@shop2020.in']
|
415 |
'Accept-Charset' : 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
|
| 417 |
for receipient in mTo:
|
416 |
'Connection':'keep-alive',
|
| 418 |
m.addRecipient(receipient)
|
417 |
'Accept-Encoding' : 'gzip,deflate,sdch'
|
| 419 |
|
418 |
}
|
| - |
|
419 |
DTR_API_BASIC_AUTH = base64.encodestring('%s:%s' % ("dtr", "dtr18Feb2015")).replace('\n', '')
|
| - |
|
420 |
parameters = ("user_id", userId),("subject", disposition_description),("message",disposition_comments)
|
| 420 |
m.setSubject("")
|
421 |
parameters = urllib.urlencode(parameters)
|
| - |
|
422 |
pushpostrequest = urllib2.Request("http://staging.profittill.com/feedbacks/crm_mail", parameters, headers=headers)
|
| 421 |
m.setTextBody("Please check App Master Data")
|
423 |
pushpostrequest.add_header("Authorization", "Basic %s" % DTR_API_BASIC_AUTH)
|
| 422 |
m.send()
|
424 |
urllib2.urlopen(pushpostrequest).read()
|
| 423 |
|
425 |
|