mentor_mailer.py 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. '''Created Jan 30, 2023 deeejas'''
  2. # coding: UTF-8
  3. import yagmail
  4. from winmentor import WinMentor
  5. from winmentor import M_mailer
  6. from winmentor import Smslink
  7. m_list = {'CHRYSOPEEA BRANDING & DESIGN SRL': {'mail': 'deeejas@mail.com', 'phone': '0754694364'}
  8. # 'Drytec': ['zsofia.torok4@gmail.com', 'vtorok@gmail.com'],
  9. # 'Ergo': 'office@ergohr.eu',
  10. # 'German': ['info@germanstone.ro', 'flori.flamand@germanstone.ro', 'freemir@web.de'],
  11. # 'Kun': 'kun_g_tibor@yahoo.com',
  12. # 'Mathe': 'tudor.aciu@gmail.com',
  13. # 'Chrysopeea': ['cristina.stan@chrysopeea.com', 'sfeliciacristina@yahoo.com'],
  14. # 'Elegance': 'bolbagelu@yahoo.com',
  15. # 'KK Invest': ['office@kkinv.ro', 'katalin.betegh@kkinv.ro'],
  16. # 'Vibro': ['tamas_neda@yahoo.com', 'romania@vibrocomp.com'],
  17. # 'Webs': 'webs_srl@yahoo.com',
  18. # 'Taurus': 'cotinghiu_dan@yahoo.com'
  19. }
  20. exclude = ['ABRON',
  21. 'ASCOMVEL',
  22. 'ASDONAT',
  23. 'ASPRO',
  24. 'ASIONAG',
  25. 'ASIVP',
  26. 'ALPHA',
  27. 'ASOBS',
  28. 'BANXI',
  29. 'BREIS',
  30. 'COMELECT',
  31. 'ECOPROT',
  32. 'EVEREST',
  33. 'FLAUR',
  34. 'GBZPFA',
  35. 'JOART',
  36. 'LUXWIN',
  37. 'MATILAND',
  38. 'MOCAN',
  39. 'SCOM',
  40. 'TERHOV',
  41. 'UNION',
  42. 'RECYC']
  43. head = ['Denumire', 'CF', 'J', 'Adresa', 'Oras', 'Judet', 'Prescurtat', 'Admin', 'AdminP', 'RCNP', 'Obs']
  44. mentor = WinMentor()
  45. office = list(mentor.filtered_firmlist(headers=head, ban=exclude)) # generator
  46. yag = yagmail.SMTP('claudia.conta.ab@gmail.com') #, oauth2_file='~/oauth2_creds.json'
  47. month_ = M_mailer.mentor_date
  48. mailer = M_mailer()
  49. taxes = mailer.tax_mailer(office, m_list, mentor, yag, month_, send=False)
  50. sms = Smslink('A297457A64817C11', 'U7BYbyXCot2I5hvR')
  51. # resp = sms.send()
  52. # print(resp.text)
  53. for company, contact in m_list.items():
  54. for tax in taxes:
  55. # print(repr(tax))
  56. if company == tax.name:
  57. # print(repr(tax))
  58. sms.message = repr(tax)
  59. sms.to = contact['phone']
  60. print(sms.to, '\n', sms.message)
  61. # resp = sms.send()
  62. # print(resp.text)