unee-t / lambda2sqs

Relays SQL triggered payloads to MEFE via a queue
https://ap-southeast-1.console.aws.amazon.com/lambda/home?region=ap-southeast-1#/applications/lambda2sqs
GNU Affero General Public License v3.0
0 stars 4 forks source link

case_updated #4

Closed franck-boullier closed 6 years ago

franck-boullier commented 6 years ago

We have a SNS event active each time a case is updated. The notification type is case_updated

We need to generate the email notification for this type of notification too.

kaihendry commented 6 years ago

https://github.com/unee-t/lambda2sns/blob/master/tests/events/case_updated.json

The only different part from the other 3 notifications is that we need to send these 2 new notifications to:

  • The reporter (unless he/she has unsubscribed to this type of notifications) and
  • The current assignee (unless he/she has unsubscribed to this type of notifications) and
  • All the invited user (unless he/she has unsubscribed to this type of notifications) and
  • exclude the user who has initiated the modification

This should not be a problem as he have all the IDs for all these users in the JSON payload

kaihendry commented 6 years ago

reporter === case_reporter_user_id, e.g. "10" assignee === new_case_assignee_user_id, e.g. "12" invited user === current_list_of_invitees, "13, 15, 23" user who has initiated the modification === user_id e.g. "174"

franck-boullier commented 6 years ago

reporter === case_reporter_user_id, e.g. "10" assignee === new_case_assignee_user_id, e.g. "12" invited user === current_list_of_invitees, "13, 15, 23" user who has initiated the modification === user_id e.g. "174"

This is correct

kaihendry commented 6 years ago

Do we generate one email and BCC people, or do we generate 5 emails in the above example?

franck-boullier commented 6 years ago

Do we generate one email and BCC people, or do we generate 5 emails in the above example?

I'm tempted to say we generate 5 emails but TBH I do not really understand the difference between the 2 options so I'll let you make a call on that @kaihendry

franck-boullier commented 6 years ago

Notifications should be sent to:

The notification routine must check if each user has subscribed to this type of notifications before sending the email notification.

franck-boullier commented 6 years ago

Above comment edited for better clarity. @kaihendry please note that the names of the variable for the user who has initiated the change (user_id) for the notification type case_updated is NOT the same as the variable for the user who has created a new message (created_by_user_id) for the notification type case_new_message.