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
Labels
Merge Requests
19
Merge Requests
19
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
3ebaa773
Commit
3ebaa773
authored
Oct 12, 2018
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: Set sender and get the user reference for the notification
parent
4415d29a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_sendAcceptedNotification.py
...n_request/SubscriptionRequest_sendAcceptedNotification.py
+11
-2
No files found.
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_sendAcceptedNotification.py
View file @
3ebaa773
portal
=
context
.
getPortalObject
()
sender
=
context
.
getSourceSectionValue
(
portal_type
=
"Person"
)
recipient
=
context
.
getDestinationSectionValue
(
portal_type
=
"Person"
)
#Define the type of notification
...
...
@@ -13,8 +14,16 @@ notification_message = portal.portal_notifications.getDocumentValue(reference=no
if
notification_message
is
None
:
raise
ValueError
,
'Unable to found Notification Message with reference "%s".'
%
notification_reference
if
reference
is
None
:
login_list
=
recipient
.
searchFolder
(
portal_type
=
"ERP5 Login"
)
if
login_list
:
reference
=
login_list
[
0
].
getReference
()
#Set notification mapping
notification_mapping_dict
=
{
'login_name'
:
reference
}
notification_mapping_dict
=
{
'login_name'
:
reference
,
'name'
:
recipient
.
getTitle
()}
if
password
:
notification_mapping_dict
.
update
(
{
'login_password'
:
password
})
...
...
@@ -29,7 +38,7 @@ else:
#Send email
portal
.
portal_notifications
.
sendMessage
(
sender
=
None
,
sender
=
sender
,
recipient
=
recipient
,
subject
=
notification_message
.
getTitle
(),
message
=
mail_text
,
...
...
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