leadguru-jobs 0.509.0__py3-none-any.whl → 0.511.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: leadguru_jobs
3
- Version: 0.509.0
3
+ Version: 0.511.0
4
4
  Summary: LGT jobs builds
5
5
  Author-email: developer@leadguru.co
6
6
  Classifier: Development Status :: 5 - Production/Stable
@@ -5,15 +5,15 @@ lgt_jobs/main.py,sha256=OUfuq8INpY54pYwdL3wV8Fy_3oScdMaj5jonUakWytY,1538
5
5
  lgt_jobs/runner.py,sha256=MZ3_UvfyDSM707UI4uPDntlKKCXkIyN6h95D1i1SoQQ,2125
6
6
  lgt_jobs/simple_job.py,sha256=sta7MP-57iwRewPycmTAc9dvSbocbGjWhb1QYYj7ccA,519
7
7
  lgt_jobs/smtp.py,sha256=TQfqlbmrBLhMS_lsaHqeIViQPtfjrIa40pcb1-CHiCY,1194
8
- lgt_jobs/assets/images/arrow.png,sha256=yecfrerF2YnMGt7R2NExxNKrQJLNwVQbBnJwOKr6kLY,228
9
- lgt_jobs/assets/images/firework.png,sha256=dfXClJNp4A-P0tdHD-mSzQp-0ZmEvDhNPoCaYy1UJNs,1402
10
- lgt_jobs/assets/images/lock.png,sha256=rqbv7-u_wmVwKTYj-esEKjKOV3xYX8zSFD6jk3bZgo4,838
11
- lgt_jobs/assets/images/logo.png,sha256=d0yX5tHtz_hO8ObWzNPryRx7rP-m-VPeRY0E3FXtNHM,2297
12
- lgt_jobs/assets/images/mail.png,sha256=2-fx-56hUcNMpMUghaxgKw7HBnXJ--TGsktd8Sr6yNU,1038
8
+ lgt_jobs/assets/images/arrow.png,sha256=Lr_zG1TyySAWX78jiojcV7j8BHe2S_Oi7eZYAfe4YbM,536
9
+ lgt_jobs/assets/images/firework.png,sha256=9d_0lUpDFfT3e4JTgp5XVb03qAdtO9yNVi1c1KoQDp8,33754
10
+ lgt_jobs/assets/images/lock.png,sha256=515llTFqboG9PYXIrXhlbPZ5lQOHXjEYyQkXc9WfJxc,5978
11
+ lgt_jobs/assets/images/logo.png,sha256=nt377FGkBalBF9Z9TYQRv9loHolTXwU8_VRYvCXXzx0,12596
12
+ lgt_jobs/assets/images/mail.png,sha256=eORzQcAMkFr7DjgtABVhJ_zFuXgO7OXv78lLF4b39B0,7168
13
13
  lgt_jobs/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- lgt_jobs/jobs/analytics.py,sha256=SiBQSXw0hUV9Ua_BaVZDZNvOIgvmbIcUGcgaZ8HtqnE,958
14
+ lgt_jobs/jobs/analytics.py,sha256=IIsWt4A1qUw3w-S-8W16uKY1FRVWfXXA41_mu4uCNiM,979
15
15
  lgt_jobs/jobs/bot_stats_update.py,sha256=zCSiX3olnipZaqUyC81TvvHvIcM1xEvsepj0ai03VoE,7397
16
- lgt_jobs/jobs/chat_history.py,sha256=0GLOg6JxshgqVtbcxox8IDBu0scM6C26XGCNPeGIffY,5675
16
+ lgt_jobs/jobs/chat_history.py,sha256=PtSBm-WF-HdXeZCotduS8omm10FplqQGOlXf9bWzfU8,6117
17
17
  lgt_jobs/jobs/inbox_leads.py,sha256=0t2JRhDL_8Ku-YxQGmwTqlHeuXOQdquV74Dsoz3_TmY,4634
18
18
  lgt_jobs/jobs/mass_message.py,sha256=1mFcBlL2MhzLbj5yrd_NyJc7TXDWCcROAzGDnr0miMU,2035
19
19
  lgt_jobs/jobs/send_code.py,sha256=dIlLPkG3GgGKIEqGiElyzrtdrnJNTL1Ak2V0xnE-WIQ,824
@@ -40,14 +40,14 @@ lgt_jobs/lgt_common/slack_client/web_client.py,sha256=oZV7oUcSXXngfMI6oXDedlQWeP
40
40
  lgt_jobs/lgt_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  lgt_jobs/lgt_data/analytics.py,sha256=Gr-7IzrnHPN9YJlIT6-NqrzVYU39vQUMKCRMsvvM5A4,22869
42
42
  lgt_jobs/lgt_data/engine.py,sha256=YJYEAj1Z4_XIhPMaoB7bp8x9ponANBzw7gZRrj6c-c4,8600
43
- lgt_jobs/lgt_data/enums.py,sha256=P-Jo_kQfFanbN5ztjQZIaWkZ6qOmAjHdypZ85ReOgdA,2407
44
- lgt_jobs/lgt_data/helpers.py,sha256=58ycqKF1z5nAw0vs6yVCg-SQet107YHyKYXaQUc7M68,157
43
+ lgt_jobs/lgt_data/enums.py,sha256=p54wjKBWz8behNZGnfsPI-sq9ELwbk9HlP7t3N9USuA,2471
44
+ lgt_jobs/lgt_data/helpers.py,sha256=NDa-V5EYaJfkGoWsmQSwSe6N_jxNxs8tHRQzW1iST6k,480
45
45
  lgt_jobs/lgt_data/model.py,sha256=DPT2ztJG9w7O0_sxbCY1vzNwz9Y-ykJq0Tfuv7-UT0g,29448
46
46
  lgt_jobs/lgt_data/mongo_repository.py,sha256=h3xA2AvqHaiQfl4vg88SdOKBczJ0P6bpkZYuHl4wMIo,47587
47
47
  lgt_jobs/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
48
  lgt_jobs/services/web_client.py,sha256=eCgzyyXco6iPwAJziyRek_3ns1bxJZKknnLIJApKeoo,2070
49
- lgt_jobs/templates/new_message.html,sha256=SNVFWnq1goVrtaTJpbEru-8vYOav1wz31z8r01hAZI8,6985
50
- leadguru_jobs-0.509.0.dist-info/METADATA,sha256=-ict_-LL5WaO7TYPVbu9dmH1A6dzy4E9aDO6dP2P04s,1319
51
- leadguru_jobs-0.509.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
52
- leadguru_jobs-0.509.0.dist-info/top_level.txt,sha256=rIuw1DqwbnZyeoarBSC-bYeGOhv9mZBs7_afl9q4_JI,9
53
- leadguru_jobs-0.509.0.dist-info/RECORD,,
49
+ lgt_jobs/templates/new_message.html,sha256=BD_E90akmQ1Wf07wtZAjeK_7DUKRmja5HFHVo_AKI24,6994
50
+ leadguru_jobs-0.511.0.dist-info/METADATA,sha256=3miWePFAxnDCGA_SG0ZREQcVLuXVnkqUZ6ynYnY7TLE,1319
51
+ leadguru_jobs-0.511.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
52
+ leadguru_jobs-0.511.0.dist-info/top_level.txt,sha256=rIuw1DqwbnZyeoarBSC-bYeGOhv9mZBs7_afl9q4_JI,9
53
+ leadguru_jobs-0.511.0.dist-info/RECORD,,
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -29,4 +29,4 @@ class TrackAnalyticsJob(BaseBackgroundJob, ABC):
29
29
  def exec(self, data: TrackAnalyticsJobData):
30
30
  with MongoClient(mongo_connection_string) as client:
31
31
  analytics_id = client.lgt_admin[data.event].insert_one(data.model_dump()).inserted_id
32
- log.info(f'Entry with id {analytics_id} has been recorded into {data.event}')
32
+ log.info(f'[TrackAnalyticsJob]: Entry with id {analytics_id} has been recorded into {data.event}')
@@ -3,6 +3,7 @@ from abc import ABC
3
3
  from typing import Optional, List
4
4
  import logging as log
5
5
  from lgt_jobs.lgt_common.slack_client.web_client import SlackWebClient, SlackMessageConvertService
6
+ from lgt_jobs.lgt_data.helpers import get_help_text
6
7
  from lgt_jobs.lgt_data.model import ChatMessage, UserModel, UserContact, DedicatedBotModel
7
8
  from lgt_jobs.lgt_data.mongo_repository import UserMongoRepository, DedicatedBotRepository, UserContactsRepository, \
8
9
  ChatRepository
@@ -37,6 +38,7 @@ class LoadChatHistoryJob(BaseBackgroundJob, ABC):
37
38
  return
38
39
  last_message = None
39
40
  last_message_contact = None
41
+ last_message_bot = None
40
42
  contacts_groups = self.contacts_repo.find_grouped_actual_contacts(user.id, spam=False, with_chat_only=True)
41
43
  for bot in bots:
42
44
  contacts = contacts_groups.get(bot.source.source_id)
@@ -51,10 +53,12 @@ class LoadChatHistoryJob(BaseBackgroundJob, ABC):
51
53
  continue
52
54
 
53
55
  if not last_message:
56
+ last_message_bot = bot
54
57
  last_message = message
55
58
  last_message_contact = contact
56
59
 
57
60
  if message.created_at > last_message.created_at and message.user == contact.sender_id:
61
+ last_message_bot = bot
58
62
  last_message = message
59
63
  last_message_contact = contact
60
64
 
@@ -62,7 +66,8 @@ class LoadChatHistoryJob(BaseBackgroundJob, ABC):
62
66
  (last_message and last_message.created_at > user.new_message_notified_at))
63
67
 
64
68
  if last_message and has_to_be_notified and last_message.user == last_message_contact.sender_id:
65
- LoadChatHistoryJob._notify_about_new_messages(user, last_message_contact, data.template_path)
69
+ LoadChatHistoryJob._notify_about_new_messages(user, last_message_contact, last_message_bot,
70
+ data.template_path)
66
71
  UserMongoRepository().set(data.user_id, new_message_notified_at=datetime.now(UTC))
67
72
 
68
73
  def _get_new_messages(self, contact: UserContact, bot: DedicatedBotModel, slack_chat: List[ChatMessage]):
@@ -107,12 +112,13 @@ class LoadChatHistoryJob(BaseBackgroundJob, ABC):
107
112
  return None
108
113
 
109
114
  @staticmethod
110
- def _notify_about_new_messages(user: UserModel, contact: UserContact, template_path: str):
115
+ def _notify_about_new_messages(user: UserModel, contact: UserContact, bot: DedicatedBotModel, template_path: str):
111
116
  with open(template_path, mode='r') as template_file:
112
117
  html = template_file.read()
118
+ chat_url = f'{portal_url}/feed?senderId={contact.sender_id}&sourceId={bot.source.source_id}'
113
119
  html = html.replace("$$USER_NAME$$", contact.name if hasattr(contact, 'name') else contact.real_name)
114
- html = html.replace("$$PORTAL_LINK$$", portal_url)
115
-
120
+ html = html.replace("$$PORTAL_LINK$$", chat_url)
121
+ html = html.replace("$$HELP_TEXT$$", get_help_text(user))
116
122
  message_data = {
117
123
  "html": html,
118
124
  "subject": 'New message(s) on Leadguru',
@@ -80,6 +80,9 @@ class ImageName(str, Enum):
80
80
  LOCK = 'lock.png'
81
81
  LOGO = 'logo.png'
82
82
  MAIL = 'mail.png'
83
+ CRY = 'cry.png'
84
+ HANDS = 'hands.png'
85
+ SAD = 'sad.png'
83
86
 
84
87
 
85
88
  class FeaturesEnum(str, Enum):
@@ -1,2 +1,11 @@
1
+ from lgt_jobs.lgt_data.model import UserModel
2
+ from lgt_jobs.lgt_data.mongo_repository import SubscriptionsRepository
3
+
4
+
1
5
  def get_linkedin_search_contact(name: str):
2
6
  return f"https://www.linkedin.com/search/results/all/?keywords={name}&origin=GLOBAL_SEARCH_HEADER&sid=u%40F"
7
+
8
+
9
+ def get_help_text(user: UserModel):
10
+ subscription = SubscriptionsRepository().find_one(id=user.subscription_id)
11
+ return 'the onboarding call with us!' if subscription.trial else 'a call with us.'
@@ -96,11 +96,11 @@
96
96
  style="border: 0; margin: 0 40px; padding-bottom: 40px">
97
97
  <tr>
98
98
  <td style="padding: 20px 0 0; border-top: 1px solid #E9EBF0; margin: 0; font-size: 14px; line-height: 20px; color: #778198; text-align: left; font-weight: 400">
99
- Check out our
99
+ Need help? Check out our
100
100
  <a style="color: #3579F6; text-decoration: none;"
101
101
  href="https://leadguru.co/features/"
102
102
  target="_blank" >Knowledge Base</a>
103
- or book a call with us.
103
+ or book $$HELP_TEXT$$
104
104
  </td>
105
105
  </tr>
106
106
  </table>