Skip to content

Commit

Permalink
Mail template (#1200)
Browse files Browse the repository at this point in the history
* - changing digite logo to nimblework logo
- add kairon logo in mail action as well

* - correcting network in service

---------

Co-authored-by: hghuge <[email protected]>
  • Loading branch information
hiteshghuge and hghuge authored May 14, 2024
1 parent 625effd commit 0f994ab
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 11 deletions.
19 changes: 19 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,24 @@ services:
- ./testing_data:/app/testing_data
- ./transformer_cache:/root/.cache/

kairon-live-agent:
image: 730423251530.dkr.ecr.us-east-1.amazonaws.com/kairon-live-agent:152905
container_name: kairon-live-agent
hostname: kairon-live-agent
ports:
- 8080:8080
environment:
MONGO_URI_LIVE_AGENT_HOST: "mongodb://192.168.100.38:27017/"
MONGO_URI_KAIRON_DB: "mongodb://192.168.100.38:27017/"
DB_NAME_LIVE_AGENT: "live_agent"
DB_NAME_CHAT: "test_conversations"
DB_NAME_KAIRON: "conversations"
JWT_SECRET: "Aquickbrownfox_24jump$9overthel@zydog"
FERNET_SECRET: "gH8F9M-3GTxT1z-XyvJXZlCfxfbMuFr2HgXDHl7Xkuw="
ALLOWED_USERS: "kairon,kairon_ui"
DATABASE_URL: "mongodb://mongo:27017/kairon"
networks:
- chatbotnetwork

networks:
chatbotnetwork:
5 changes: 5 additions & 0 deletions kairon/shared/actions/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ def prepare_email_body(tracker_events, subject: str, user_email: str = None):
conversation_mail_template = Utility.email_conf['email']['templates']['conversation']
bot_msg_template = Utility.email_conf['email']['templates']['bot_msg_conversation']
user_msg_template = Utility.email_conf['email']['templates']['user_msg_conversation']
base_url = Utility.environment["app"]["frontend_url"]
for event in tracker_events:
msg = ""
if list(event.keys())[0] == 'bot':
Expand All @@ -710,16 +711,20 @@ def prepare_email_body(tracker_events, subject: str, user_email: str = None):
conversation_mail_template = conversation_mail_template.replace('USER_EMAIL', user_email)
conversation_mail_template.replace('This email was sent to USER_EMAIL', '')
conversation_mail_template = conversation_mail_template.replace('CONVERSATION_REPLACE', html_output)
conversation_mail_template = conversation_mail_template.replace('CONVERSATION_REPLACE', html_output)
conversation_mail_template = conversation_mail_template.replace("BASE_URL", base_url)
return conversation_mail_template

@staticmethod
def prepare_email_text(custom_text_mail: Dict, subject: str, user_email: str = None):
custom_text_mail_template = Utility.email_conf['email']['templates']['custom_text_mail']
custom_text_mail_template = custom_text_mail_template.replace('SUBJECT', subject)
base_url = Utility.environment["app"]["frontend_url"]
if not ActionUtility.is_empty(user_email):
custom_text_mail_template = custom_text_mail_template.replace('USER_EMAIL', user_email)
custom_text_mail_template.replace('This email was sent to USER_EMAIL', '')
custom_text_mail_template = custom_text_mail_template.replace('CUSTOM_TEXT', custom_text_mail)
custom_text_mail_template = custom_text_mail_template.replace("BASE_URL", base_url)
return custom_text_mail_template

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion template/emails/addTrustedDevice.html
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ <h1 style="font-size: 24px; font-weight: 600; margin: 0">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" style="padding: 36px 0 10px">
<img src="BASE_URL/assets/emails/digite-logo.png" alt="Digite"
<img src="BASE_URL/assets/emails/nimble-logo.png" alt="Digite"
width="106px" />
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion template/emails/conversation.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ <h1 style="font-size: 20px; font-weight: 600; margin: 0">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" style="padding: 36px 0 10px">
<img src="BASE_URL/assets/emails/digite-logo.png" alt="Digite"
<img src="BASE_URL/assets/emails/nimble-logo.png" alt="Digite"
width="106px" />
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion template/emails/memberAddAccept.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ <h1 style="font-size: 24px; font-weight: 600; margin: 0">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" style="padding: 36px 0 10px">
<img src="BASE_URL/assets/emails/digite-logo.png" alt="Digite"
<img src="BASE_URL/assets/emails/nimble-logo.png" alt="Digite"
width="106px" />
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion template/emails/memberAddConfirmation.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ <h1 style="font-size: 24px; font-weight: 600; margin: 0">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" style="padding: 36px 0 10px">
<img src="BASE_URL/assets/emails/digite-logo.png" alt="Digite"
<img src="BASE_URL/assets/emails/nimble-logo.png" alt="Digite"
width="106px" />
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion template/emails/memberUpdateRole.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ <h1 style="font-size: 24px; font-weight: 600; margin: 0">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" style="padding: 36px 0 10px">
<img src="BASE_URL/assets/emails/digite-logo.png" alt="Digite"
<img src="BASE_URL/assets/emails/nimble-logo.png" alt="Digite"
width="106px" />
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion template/emails/passwordGenerated.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ <h1 style="font-size: 24px; font-weight: 600; margin: 0">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" style="padding: 36px 0 10px">
<img src="BASE_URL/assets/emails/digite-logo.png" alt="Digite"
<img src="BASE_URL/assets/emails/nimble-logo.png" alt="Digite"
width="106px" />
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion template/emails/passwordReset.html
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ <h1 style="font-size: 24px; font-weight: 600; margin: 0">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" style="padding: 36px 0 10px">
<img src="BASE_URL/assets/emails/digite-logo.png" alt="Digite"
<img src="BASE_URL/assets/emails/nimble-logo.png" alt="Digite"
width="106px" />
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion template/emails/passwordResetConfirmation.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ <h1 style="font-size: 24px; font-weight: 600; margin: 0">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" style="padding: 36px 0 10px">
<img src="BASE_URL/assets/emails/digite-logo.png" alt="Digite"
<img src="BASE_URL/assets/emails/nimble-logo.png" alt="Digite"
width="106px" />
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion template/emails/untrustedLogin.html
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ <h1 style="font-size: 24px; font-weight: 600; margin: 0">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" style="padding: 36px 0 10px">
<img src="BASE_URL/assets/emails/digite-logo.png" alt="Digite" width="106px" />
<img src="BASE_URL/assets/emails/nimble-logo.png" alt="Digite" width="106px" />
</td>
</tr>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion template/emails/verification.html
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ <h1 style="font-size: 24px; font-weight: 600; margin: 0">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" style="padding: 36px 0 10px">
<img src="BASE_URL/assets/emails/digite-logo.png" alt="Digite"
<img src="BASE_URL/assets/emails/nimble-logo.png" alt="Digite"
width="106px" />
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion template/emails/verificationConfirmation.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ <h1 style="font-size: 24px; font-weight: 600; margin: 0">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" style="padding: 36px 0 10px">
<img src="BASE_URL/assets/emails/digite-logo.png" alt="Digite"
<img src="BASE_URL/assets/emails/nimble-logo.png" alt="Digite"
width="106px" />
</td>
</tr>
Expand Down

0 comments on commit 0f994ab

Please sign in to comment.