[backend/frontend] Creation of email templates and sending when creating a user (#11487)#11676
[backend/frontend] Creation of email templates and sending when creating a user (#11487)#11676JeremyCloarec merged 71 commits intomasterfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #11676 +/- ##
==========================================
- Coverage 65.39% 65.35% -0.05%
==========================================
Files 730 736 +6
Lines 72703 73008 +305
Branches 8079 8106 +27
==========================================
+ Hits 47546 47713 +167
- Misses 25157 25295 +138 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a2f446e to
9c8b4ba
Compare
54d01d0 to
1e69e12
Compare
6f5a5b9 to
18042b8
Compare
|
Feature to test :
|
| } | ||
| }; | ||
|
|
||
| export const sendEmailToUser = async (context, user, input) => { |
There was a problem hiding this comment.
I wonder about moving that to emailTemplate domain.... it's not 100% accurate but I'm so sad when we continue to make this file bigger and bigger.
| throw UnsupportedError('Target user not found', { id: input.target_user_id }); | ||
| } | ||
|
|
||
| const organizationIds = targetUser['participate-to'] || []; |
There was a problem hiding this comment.
if you take user from cache, you don't need to do that.
const users = await getEntitiesListFromCache<AuthUser>(testContext, ADMIN_USER, ENTITY_TYPE_USER);
// then find your user.
| let organizationNames = []; | ||
| if (organizationIds.length > 0) { | ||
| const organizations = await Promise.all( | ||
| organizationIds.map((orgId) => internalLoadById(context, user, orgId)) | ||
| ); | ||
| organizationNames = organizations | ||
| .filter((org) => !!org) | ||
| .map((org) => org.name) | ||
| .filter((name) => !!name); | ||
| } |
There was a problem hiding this comment.
Would be better to do that only if objectOrganization is used in template
aHenryJard
left a comment
There was a problem hiding this comment.
Blocking PR until api_token is removed from email templates.
25958a7 to
8ba6d28
Compare
…ing a user (OpenCTI-Platform#11487) (OpenCTI-Platform#11676) Co-authored-by: Jeremy Cloarec <jeremy.cloarec@filigran.io> Co-authored-by: Valentin Bouzin <valentin.bouzin@filigran.io>
Proposed changes
client PR OpenCTI-Platform/client-python#940
Related issues
Checklist
Further comments