Skip to content

Commit

Permalink
Release: User notifications received only by the direct community (#126)
Browse files Browse the repository at this point in the history
* fixed wrong field name in notification email template
* Only the direct community to receive the aspect created notification for users

Co-authored-by: Valentin Yanakiev <[email protected]>
Co-authored-by: Neil Smyth <[email protected]>
  • Loading branch information
valentinyanakiev and techsmyth authored Jun 3, 2022
1 parent b2e29f1 commit 2173ca8
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 17 deletions.
26 changes: 13 additions & 13 deletions notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ recipients:
resource_id:
- name: member
rules:
- rule:
type: HUB_MEMBER
resource_id: <entityID>
- rule:
type: CHALLENGE_MEMBER
resource_id: <challengeID>
resource_id: <entityID>
- rule:
type: OPPORTUNITY_MEMBER
resource_id: <opportunityID>
- rule:
type: HUB_MEMBER
resource_id: <hubID>
resource_id: <entityID>
communication_discussion_created:
- name: admin
rules:
Expand All @@ -154,15 +154,15 @@ recipients:
resource_id:
- name: member
rules:
- rule:
type: HUB_MEMBER
resource_id: <entityID>
- rule:
type: CHALLENGE_MEMBER
resource_id: <challengeID>
resource_id: <entityID>
- rule:
type: OPPORTUNITY_MEMBER
resource_id: <opportunityID>
- rule:
type: HUB_MEMBER
resource_id: <hubID>
resource_id: <entityID>
community_review_submitted:
- name: admin
rules:
Expand Down Expand Up @@ -207,13 +207,13 @@ recipients:
rules:
- rule:
type: HUB_MEMBER
resource_id: <hubID>
resource_id: <entityID>
- rule:
type: CHALLENGE_MEMBER
resource_id: <challengeID>
resource_id: <entityID>
- rule:
type: OPPORTUNITY_MEMBER
resource_id: <opportunityID>
resource_id: <entityID>
aspect_comment_created:
- name: owner
rules:
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alkemio-notifications",
"version": "0.5.5",
"version": "0.5.6",
"description": "Alkemio notifications service",
"author": "Alkemio Foundation",
"private": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export class AspectCreatedNotificationBuilder implements INotificationBuilder {
hubID: payload.hub.id,
challengeID: payload.hub?.challenge?.id ?? '',
opportunityID: payload.hub?.challenge?.opportunity?.id ?? '',
entityID:
payload.hub?.challenge?.opportunity?.id ??
payload.hub?.challenge?.id ??
payload.hub.id,
};

return this.notificationBuilder.build({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export class CommunicationDiscussionCreatedNotificationBuilder
hubID: payload.hub.id,
challengeID: payload.hub.challenge?.id ?? '',
opportunityID: payload.hub.challenge?.opportunity?.id ?? '',
entityID:
payload.hub?.challenge?.opportunity?.id ??
payload.hub?.challenge?.id ??
payload.hub.id,
};

return this.notificationBuilder.build({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export class CommunicationUpdateCreatedNotificationBuilder
hubID: payload.hub.id,
challengeID: payload.hub.challenge?.id ?? '',
opportunityID: payload.hub.challenge?.opportunity?.id ?? '',
entityID:
payload.hub?.challenge?.opportunity?.id ??
payload.hub?.challenge?.id ??
payload.hub.id,
};

return this.notificationBuilder.build({
Expand Down
2 changes: 1 addition & 1 deletion src/templates/community.new.member.admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = () => ({
{% block content %}
Hi {{recipient.firstname}},<br><br>
User {{member.displayName}} joined the {{community.name}} community
User {{member.name}} joined the {{community.name}} community
<br/>
Sincerely yours,
{% endblock %}
Expand Down

0 comments on commit 2173ca8

Please sign in to comment.