Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arnaud Véron
slapos.core
Commits
5718ebfc
Commit
5718ebfc
authored
Nov 20, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: Include name and proper language on Notification
On Regularisation Requests context.
parent
777dc230
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
12 deletions
+98
-12
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/Person_checkToCreateRegularisationRequest.py
...s/slapos_crm/Person_checkToCreateRegularisationRequest.py
+18
-4
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/RegularisationRequest_triggerAcknowledgmentEscalation.py
.../RegularisationRequest_triggerAcknowledgmentEscalation.py
+20
-2
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/RegularisationRequest_triggerDeleteReminderEscalation.py
.../RegularisationRequest_triggerDeleteReminderEscalation.py
+20
-2
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/RegularisationRequest_triggerStopAcknowledgmentEscalation.py
...ularisationRequest_triggerStopAcknowledgmentEscalation.py
+20
-2
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/RegularisationRequest_triggerStopReminderEscalation.py
...rm/RegularisationRequest_triggerStopReminderEscalation.py
+20
-2
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/Person_checkToCreateRegularisationRequest.py
View file @
5718ebfc
...
@@ -63,22 +63,36 @@ if int(outstanding_amount) > 0:
...
@@ -63,22 +63,36 @@ if int(outstanding_amount) > 0:
ticket
.
reindexObject
(
activate_kw
=
{
'tag'
:
tag
})
ticket
.
reindexObject
(
activate_kw
=
{
'tag'
:
tag
})
# Notify using user's language
language
=
context
.
getLanguage
(
"en"
)
notification_message
=
context
.
getPortalObject
().
portal_notifications
.
getDocumentValue
(
notification_message
=
context
.
getPortalObject
().
portal_notifications
.
getDocumentValue
(
reference
=
"slapos-crm.create.regularisation.request"
)
reference
=
"slapos-crm.create.regularisation.request"
,
language
=
language
)
if
notification_message
is
None
:
if
notification_message
is
None
:
subject
=
'Invoice payment requested'
subject
=
'Invoice payment requested'
body
=
"""Dear
user
,
body
=
"""Dear
%s
,
A new invoice has been generated.
A new invoice has been generated.
You can access it in your invoice section at %s.
You can access it in your invoice section at %s.
Regards,
Regards,
The slapos team
The slapos team
"""
%
portal
.
portal_preferences
.
getPreferredSlaposWebSiteUrl
(
)
"""
%
(
context
.
getTitle
(),
portal
.
portal_preferences
.
getPreferredSlaposWebSiteUrl
()
)
else
:
else
:
notification_mapping_dict
=
{
'user_name'
:
context
.
getTitle
()}
subject
=
notification_message
.
getTitle
()
subject
=
notification_message
.
getTitle
()
body
=
notification_message
.
convert
(
format
=
'text'
)[
1
]
# Preserve HTML else convert to text
if
notification_message
.
getContentType
()
==
"text/html"
:
body
=
notification_message
.
asEntireHTML
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
notification_mapping_dict
})
else
:
body
=
notification_message
.
asText
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
notification_mapping_dict
})
mail_message
=
ticket
.
RegularisationRequest_checkToSendUniqEvent
(
mail_message
=
ticket
.
RegularisationRequest_checkToSendUniqEvent
(
portal
.
portal_preferences
.
getPreferredRegularisationRequestResource
(),
portal
.
portal_preferences
.
getPreferredRegularisationRequestResource
(),
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/RegularisationRequest_triggerAcknowledgmentEscalation.py
View file @
5718ebfc
...
@@ -2,7 +2,15 @@ from zExceptions import Unauthorized
...
@@ -2,7 +2,15 @@ from zExceptions import Unauthorized
if
REQUEST
is
not
None
:
if
REQUEST
is
not
None
:
raise
Unauthorized
raise
Unauthorized
notification_message
=
context
.
getPortalObject
().
portal_notifications
.
getDocumentValue
(
reference
=
"slapos-crm.acknowledgment.escalation"
)
portal
=
context
.
getPortalObject
()
language
=
"en"
recipient
=
context
.
getDestinationSectionValue
()
if
recipient
is
not
None
:
language
=
recipient
.
getLanguage
(
"en"
)
notification_message
=
portal
.
portal_notifications
.
getDocumentValue
(
language
=
language
,
reference
=
"slapos-crm.acknowledgment.escalation"
)
if
notification_message
is
None
:
if
notification_message
is
None
:
subject
=
'Reminder: invoice payment requested'
subject
=
'Reminder: invoice payment requested'
body
=
"""Dear user,
body
=
"""Dear user,
...
@@ -15,8 +23,18 @@ The slapos team
...
@@ -15,8 +23,18 @@ The slapos team
"""
%
context
.
getPortalObject
().
portal_preferences
.
getPreferredSlaposWebSiteUrl
()
"""
%
context
.
getPortalObject
().
portal_preferences
.
getPreferredSlaposWebSiteUrl
()
else
:
else
:
notification_mapping_dict
=
{
'user_name'
:
context
.
getDestinationSectionTitle
()}
subject
=
notification_message
.
getTitle
()
subject
=
notification_message
.
getTitle
()
body
=
notification_message
.
convert
(
format
=
'text'
)[
1
]
# Preserve HTML else convert to text
if
notification_message
.
getContentType
()
==
"text/html"
:
body
=
notification_message
.
asEntireHTML
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
notification_mapping_dict
})
else
:
body
=
notification_message
.
asText
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
notification_mapping_dict
})
return
context
.
RegularisationRequest_checkToTriggerNextEscalationStep
(
return
context
.
RegularisationRequest_checkToTriggerNextEscalationStep
(
delay_period_in_days
=
15
,
delay_period_in_days
=
15
,
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/RegularisationRequest_triggerDeleteReminderEscalation.py
View file @
5718ebfc
...
@@ -2,7 +2,15 @@ from zExceptions import Unauthorized
...
@@ -2,7 +2,15 @@ from zExceptions import Unauthorized
if
REQUEST
is
not
None
:
if
REQUEST
is
not
None
:
raise
Unauthorized
raise
Unauthorized
notification_message
=
context
.
getPortalObject
().
portal_notifications
.
getDocumentValue
(
reference
=
"slapos-crm.delete.reminder.escalation"
)
portal
=
context
.
getPortalObject
()
language
=
"en"
recipient
=
context
.
getDestinationSectionValue
()
if
recipient
is
not
None
:
language
=
recipient
.
getLanguage
(
"en"
)
notification_message
=
portal
.
portal_notifications
.
getDocumentValue
(
language
=
language
,
reference
=
"slapos-crm.delete.reminder.escalation"
)
if
notification_message
is
None
:
if
notification_message
is
None
:
subject
=
'Acknowledgment: instances deleted'
subject
=
'Acknowledgment: instances deleted'
body
=
"""Dear user,
body
=
"""Dear user,
...
@@ -14,8 +22,18 @@ Regards,
...
@@ -14,8 +22,18 @@ Regards,
The slapos team
The slapos team
"""
%
context
.
getPortalObject
().
portal_preferences
.
getPreferredSlaposWebSiteUrl
()
"""
%
context
.
getPortalObject
().
portal_preferences
.
getPreferredSlaposWebSiteUrl
()
else
:
else
:
notification_mapping_dict
=
{
'user_name'
:
context
.
getDestinationSectionTitle
()}
subject
=
notification_message
.
getTitle
()
subject
=
notification_message
.
getTitle
()
body
=
notification_message
.
convert
(
format
=
'text'
)[
1
]
# Preserve HTML else convert to text
if
notification_message
.
getContentType
()
==
"text/html"
:
body
=
notification_message
.
asEntireHTML
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
notification_mapping_dict
})
else
:
body
=
notification_message
.
asText
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
notification_mapping_dict
})
return
context
.
RegularisationRequest_checkToTriggerNextEscalationStep
(
return
context
.
RegularisationRequest_checkToTriggerNextEscalationStep
(
delay_period_in_days
=
10
,
delay_period_in_days
=
10
,
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/RegularisationRequest_triggerStopAcknowledgmentEscalation.py
View file @
5718ebfc
...
@@ -2,7 +2,15 @@ from zExceptions import Unauthorized
...
@@ -2,7 +2,15 @@ from zExceptions import Unauthorized
if
REQUEST
is
not
None
:
if
REQUEST
is
not
None
:
raise
Unauthorized
raise
Unauthorized
notification_message
=
context
.
getPortalObject
().
portal_notifications
.
getDocumentValue
(
reference
=
"slapos-crm.stop.acknowledgment.escalation"
)
portal
=
context
.
getPortalObject
()
language
=
"en"
recipient
=
context
.
getDestinationSectionValue
()
if
recipient
is
not
None
:
language
=
recipient
.
getLanguage
(
"en"
)
notification_message
=
portal
.
portal_notifications
.
getDocumentValue
(
language
=
language
,
reference
=
"slapos-crm.stop.acknowledgment.escalation"
)
if
notification_message
is
None
:
if
notification_message
is
None
:
subject
=
'Last reminder: invoice payment requested'
subject
=
'Last reminder: invoice payment requested'
body
=
"""Dear user,
body
=
"""Dear user,
...
@@ -14,8 +22,18 @@ Regards,
...
@@ -14,8 +22,18 @@ Regards,
The slapos team
The slapos team
"""
%
context
.
getPortalObject
().
portal_preferences
.
getPreferredSlaposWebSiteUrl
()
"""
%
context
.
getPortalObject
().
portal_preferences
.
getPreferredSlaposWebSiteUrl
()
else
:
else
:
notification_mapping_dict
=
{
'user_name'
:
context
.
getDestinationSectionTitle
()}
subject
=
notification_message
.
getTitle
()
subject
=
notification_message
.
getTitle
()
body
=
notification_message
.
convert
(
format
=
'text'
)[
1
]
# Preserve HTML else convert to text
if
notification_message
.
getContentType
()
==
"text/html"
:
body
=
notification_message
.
asEntireHTML
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
notification_mapping_dict
})
else
:
body
=
notification_message
.
asText
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
notification_mapping_dict
})
return
context
.
RegularisationRequest_checkToTriggerNextEscalationStep
(
return
context
.
RegularisationRequest_checkToTriggerNextEscalationStep
(
delay_period_in_days
=
7
,
delay_period_in_days
=
7
,
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/RegularisationRequest_triggerStopReminderEscalation.py
View file @
5718ebfc
...
@@ -2,7 +2,15 @@ from zExceptions import Unauthorized
...
@@ -2,7 +2,15 @@ from zExceptions import Unauthorized
if
REQUEST
is
not
None
:
if
REQUEST
is
not
None
:
raise
Unauthorized
raise
Unauthorized
notification_message
=
context
.
getPortalObject
().
portal_notifications
.
getDocumentValue
(
reference
=
"slapos-crm.stop.reminder.escalation"
)
portal
=
context
.
getPortalObject
()
language
=
"en"
recipient
=
context
.
getDestinationSectionValue
()
if
recipient
is
not
None
:
language
=
recipient
.
getLanguage
(
"en"
)
notification_message
=
portal
.
portal_notifications
.
getDocumentValue
(
language
=
language
,
reference
=
"slapos-crm.stop.reminder.escalation"
)
if
notification_message
is
None
:
if
notification_message
is
None
:
subject
=
'Acknowledgment: instances stopped'
subject
=
'Acknowledgment: instances stopped'
body
=
"""Dear user,
body
=
"""Dear user,
...
@@ -14,8 +22,18 @@ Regards,
...
@@ -14,8 +22,18 @@ Regards,
The slapos team
The slapos team
"""
%
context
.
getPortalObject
().
portal_preferences
.
getPreferredSlaposWebSiteUrl
()
"""
%
context
.
getPortalObject
().
portal_preferences
.
getPreferredSlaposWebSiteUrl
()
else
:
else
:
notification_mapping_dict
=
{
'user_name'
:
context
.
getDestinationSectionTitle
()}
subject
=
notification_message
.
getTitle
()
subject
=
notification_message
.
getTitle
()
body
=
notification_message
.
convert
(
format
=
'text'
)[
1
]
# Preserve HTML else convert to text
if
notification_message
.
getContentType
()
==
"text/html"
:
body
=
notification_message
.
asEntireHTML
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
notification_mapping_dict
})
else
:
body
=
notification_message
.
asText
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
notification_mapping_dict
})
return
context
.
RegularisationRequest_checkToTriggerNextEscalationStep
(
return
context
.
RegularisationRequest_checkToTriggerNextEscalationStep
(
delay_period_in_days
=
7
,
delay_period_in_days
=
7
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment