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
Ophélie Gagnard
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
Show 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
()
portal
=
context
.
getPortalObject
()
sender
=
context
.
getSourceSectionValue
(
portal_type
=
"Person"
)
recipient
=
context
.
getDestinationSectionValue
(
portal_type
=
"Person"
)
recipient
=
context
.
getDestinationSectionValue
(
portal_type
=
"Person"
)
#Define the type of notification
#Define the type of notification
...
@@ -13,8 +14,16 @@ notification_message = portal.portal_notifications.getDocumentValue(reference=no
...
@@ -13,8 +14,16 @@ notification_message = portal.portal_notifications.getDocumentValue(reference=no
if
notification_message
is
None
:
if
notification_message
is
None
:
raise
ValueError
,
'Unable to found Notification Message with reference "%s".'
%
notification_reference
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
#Set notification mapping
notification_mapping_dict
=
{
'login_name'
:
reference
}
notification_mapping_dict
=
{
'login_name'
:
reference
,
'name'
:
recipient
.
getTitle
()}
if
password
:
if
password
:
notification_mapping_dict
.
update
(
notification_mapping_dict
.
update
(
{
'login_password'
:
password
})
{
'login_password'
:
password
})
...
@@ -29,7 +38,7 @@ else:
...
@@ -29,7 +38,7 @@ else:
#Send email
#Send email
portal
.
portal_notifications
.
sendMessage
(
portal
.
portal_notifications
.
sendMessage
(
sender
=
None
,
sender
=
sender
,
recipient
=
recipient
,
recipient
=
recipient
,
subject
=
notification_message
.
getTitle
(),
subject
=
notification_message
.
getTitle
(),
message
=
mail_text
,
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