@silexpert/core 1.0.123 → 1.0.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/api/resources/Employee.d.ts.map +1 -1
- package/es/api/resources/Employee.js +3 -2
- package/es/api/resources/Employee.js.map +1 -1
- package/es/api/resources/Mail.d.ts +2 -1
- package/es/api/resources/Mail.d.ts.map +1 -1
- package/es/api/resources/Mail.js +3 -0
- package/es/api/resources/Mail.js.map +1 -1
- package/es/api/resources/SocietyConfigBalanceSheet.d.ts +1 -1
- package/es/api/resources/SocietyConfigBalanceSheet.d.ts.map +1 -1
- package/es/api/resources/SocietyConfigBalanceSheet.js +2 -2
- package/es/api/resources/SocietyConfigBalanceSheet.js.map +1 -1
- package/es/types/Enum/BalanceSheet.d.ts +1 -1
- package/es/types/Enum/BalanceSheet.js +1 -1
- package/es/types/Enum/BalanceSheet.js.map +1 -1
- package/es/types/Enum/BrandComptalib.js +1 -1
- package/es/types/Enum/BrandComptalib.js.map +1 -1
- package/es/types/Enum/DepositDocumentType.d.ts +10 -0
- package/es/types/Enum/DepositDocumentType.d.ts.map +1 -1
- package/es/types/Enum/DepositDocumentType.js +12 -0
- package/es/types/Enum/DepositDocumentType.js.map +1 -1
- package/es/types/Enum/Ged.d.ts +4 -0
- package/es/types/Enum/Ged.d.ts.map +1 -1
- package/es/types/Enum/Ged.js +26 -0
- package/es/types/Enum/Ged.js.map +1 -1
- package/es/types/Enum/MailAuto.d.ts +17 -7
- package/es/types/Enum/MailAuto.d.ts.map +1 -1
- package/es/types/Enum/MailAuto.js +28 -6
- package/es/types/Enum/MailAuto.js.map +1 -1
- package/es/types/Enum/RevisionGuide.d.ts +3 -3
- package/es/types/Enum/RevisionGuide.d.ts.map +1 -1
- package/es/types/Enum/RevisionGuide.js +3 -3
- package/es/types/Enum/RevisionGuide.js.map +1 -1
- package/es/types/Interface/api/mail/QueryGetSignature.d.ts +6 -0
- package/es/types/Interface/api/mail/QueryGetSignature.d.ts.map +1 -0
- package/es/types/Interface/api/mail/QueryGetSignature.js +32 -0
- package/es/types/Interface/api/mail/QueryGetSignature.js.map +1 -0
- package/es/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.js +1 -1
- package/es/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.js.map +1 -1
- package/es/types/Interface/models/IGedFile.d.ts +2 -0
- package/es/types/Interface/models/IGedFile.d.ts.map +1 -1
- package/es/types/Interface/models/IGedFile.js.map +1 -1
- package/es/types/Interface/models/IPaymentExpectation.d.ts +1 -0
- package/es/types/Interface/models/IPaymentExpectation.d.ts.map +1 -1
- package/es/types/Interface/models/IPaymentExpectation.js.map +1 -1
- package/es/types/Interface/models/ISociety.d.ts +2 -1
- package/es/types/Interface/models/ISociety.d.ts.map +1 -1
- package/es/types/Interface/models/ISociety.js.map +1 -1
- package/es/types/Interface/models/ISocietyConfigBalanceSheet.d.ts +6 -2
- package/es/types/Interface/models/ISocietyConfigBalanceSheet.d.ts.map +1 -1
- package/es/types/Interface/models/ISocietyConfigBalanceSheet.js.map +1 -1
- package/es/types/index.d.ts +1 -0
- package/es/types/index.d.ts.map +1 -1
- package/es/types/index.js +1 -0
- package/es/types/index.js.map +1 -1
- package/es/utils/commercialManagement/templates/body.d.ts.map +1 -1
- package/es/utils/commercialManagement/templates/body.js +2 -1
- package/es/utils/commercialManagement/templates/body.js.map +1 -1
- package/es/utils/commercialManagement/templates/common.js +1 -1
- package/es/utils/commercialManagement/templates/common.js.map +1 -1
- package/es/utils/email/templates/signature.d.ts +2 -0
- package/es/utils/email/templates/signature.d.ts.map +1 -0
- package/es/utils/email/templates/signature.js +196 -0
- package/es/utils/email/templates/signature.js.map +1 -0
- package/es/utils/email.d.ts +2 -0
- package/es/utils/email.d.ts.map +1 -0
- package/es/utils/email.js +223 -0
- package/es/utils/email.js.map +1 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.d.ts.map +1 -1
- package/es/utils/index.js +1 -0
- package/es/utils/index.js.map +1 -1
- package/js/api/resources/Employee.js +4 -2
- package/js/api/resources/Employee.js.map +1 -1
- package/js/api/resources/Mail.js +6 -0
- package/js/api/resources/Mail.js.map +1 -1
- package/js/api/resources/SocietyConfigBalanceSheet.js +2 -2
- package/js/api/resources/SocietyConfigBalanceSheet.js.map +1 -1
- package/js/types/Enum/BalanceSheet.js +1 -1
- package/js/types/Enum/BalanceSheet.js.map +1 -1
- package/js/types/Enum/BrandComptalib.js +1 -1
- package/js/types/Enum/BrandComptalib.js.map +1 -1
- package/js/types/Enum/DepositDocumentType.js +17 -1
- package/js/types/Enum/DepositDocumentType.js.map +1 -1
- package/js/types/Enum/Ged.js +19 -0
- package/js/types/Enum/Ged.js.map +1 -1
- package/js/types/Enum/MailAuto.js +34 -6
- package/js/types/Enum/MailAuto.js.map +1 -1
- package/js/types/Enum/RevisionGuide.js +3 -3
- package/js/types/Enum/RevisionGuide.js.map +1 -1
- package/js/types/Interface/api/mail/QueryGetSignature.js +33 -0
- package/js/types/Interface/api/mail/QueryGetSignature.js.map +1 -0
- package/js/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.js +1 -1
- package/js/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.js.map +1 -1
- package/js/types/index.js +12 -0
- package/js/types/index.js.map +1 -1
- package/js/utils/commercialManagement/templates/body.js +2 -1
- package/js/utils/commercialManagement/templates/body.js.map +1 -1
- package/js/utils/commercialManagement/templates/common.js +1 -1
- package/js/utils/commercialManagement/templates/common.js.map +1 -1
- package/js/utils/email/templates/signature.js +201 -0
- package/js/utils/email/templates/signature.js.map +1 -0
- package/js/utils/email.js +317 -0
- package/js/utils/email.js.map +1 -0
- package/js/utils/index.js +12 -0
- package/js/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Employee.ts +3 -2
- package/ts/api/resources/Mail.ts +5 -0
- package/ts/api/resources/SocietyConfigBalanceSheet.ts +2 -2
- package/ts/types/Enum/BalanceSheet.ts +1 -1
- package/ts/types/Enum/BrandComptalib.ts +1 -1
- package/ts/types/Enum/DepositDocumentType.ts +12 -0
- package/ts/types/Enum/Ged.ts +27 -0
- package/ts/types/Enum/MailAuto.ts +30 -7
- package/ts/types/Enum/RevisionGuide.ts +3 -3
- package/ts/types/Interface/api/mail/QueryGetSignature.ts +21 -0
- package/ts/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.ts +1 -1
- package/ts/types/Interface/models/IGedFile.ts +2 -0
- package/ts/types/Interface/models/IPaymentExpectation.ts +1 -0
- package/ts/types/Interface/models/ISociety.ts +2 -0
- package/ts/types/Interface/models/ISocietyConfigBalanceSheet.ts +6 -2
- package/ts/types/index.ts +1 -0
- package/ts/utils/commercialManagement/templates/body.ts +2 -1
- package/ts/utils/commercialManagement/templates/common.ts +1 -1
- package/ts/utils/email/templates/signature.ts +198 -0
- package/ts/utils/email.ts +230 -0
- package/ts/utils/index.ts +1 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
const logoClementine = `<% if (brandName === 'Clementine') { %><tr>
|
|
7
|
+
<td
|
|
8
|
+
colspan="3"
|
|
9
|
+
class="logo"
|
|
10
|
+
style=""
|
|
11
|
+
width="850">
|
|
12
|
+
<img
|
|
13
|
+
src="https://clementine-website.s3.eu-west-3.amazonaws.com/logo_2022.png"
|
|
14
|
+
alt="Logo"
|
|
15
|
+
height="32"
|
|
16
|
+
style="padding-bottom: 10px;">
|
|
17
|
+
</td>
|
|
18
|
+
</tr><% } %>`;
|
|
19
|
+
const avatar = `<% if (!forceRole && user?.avatar?.token) { %>
|
|
20
|
+
<td
|
|
21
|
+
class="avatar"
|
|
22
|
+
style="text-align:center; padding: 20px 0 20px 20px; position: relative;"
|
|
23
|
+
width="100">
|
|
24
|
+
<p style="padding: 20px;background-image: url('https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_quotes.png');background-size: 26%;background-position: 81% -3%;background-repeat: no-repeat;">
|
|
25
|
+
<img
|
|
26
|
+
style="max-height: 90px;max-width: 90px; border-radius: 100%; padding-top: 1Opx"
|
|
27
|
+
src="
|
|
28
|
+
<%= hostS3 %>users/<%= user.id %>/<%= user.avatar.token %>
|
|
29
|
+
"
|
|
30
|
+
/>
|
|
31
|
+
</p>
|
|
32
|
+
</td>
|
|
33
|
+
<% } %>`;
|
|
34
|
+
const footer = `<% if(brandName === 'Clementine') { %>
|
|
35
|
+
<tr>
|
|
36
|
+
<td
|
|
37
|
+
style="clear:both; padding-top: 20px; font-size:17px; line-height:14px; color:#ADADAD; text-align: justify; font-family: Arial;"
|
|
38
|
+
colspan="4">
|
|
39
|
+
<table style="width: 100%" width="100%">
|
|
40
|
+
<tr>
|
|
41
|
+
<td style="padding:0 10px 0 0" width="120">
|
|
42
|
+
<a href="https://app.compta-clementine.fr/" target="_blank" style="text-decoration: none; color: #6E6E71; white-space: nowrap;">
|
|
43
|
+
<img
|
|
44
|
+
src="https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_connect2.png"
|
|
45
|
+
style="vertical-align: text-top;"
|
|
46
|
+
width="20"
|
|
47
|
+
alt="Connexion"> Connexion
|
|
48
|
+
</a>
|
|
49
|
+
</td>
|
|
50
|
+
<td style="padding:0 10px 0 0" width="170">
|
|
51
|
+
<a href="mailto:<%= supportMail %>" target="_blank" style="text-decoration: none; color: #6E6E71; white-space: nowrap;">
|
|
52
|
+
<img
|
|
53
|
+
src="https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_support2.png"
|
|
54
|
+
style="vertical-align: text-top;"
|
|
55
|
+
width="17"
|
|
56
|
+
alt="Support technique"> Support technique
|
|
57
|
+
</a>
|
|
58
|
+
</td>
|
|
59
|
+
<td style="padding:0 5px 0 0" width="24">
|
|
60
|
+
<a href="https://www.youtube.com/channel/UCVnCpcLdRwuYBLvAphHsvig/" target="_blank" style="vertical-align: middle;"><img
|
|
61
|
+
src="https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_youtube.png"
|
|
62
|
+
alt="YouTube"
|
|
63
|
+
style="width: 20px"></a>
|
|
64
|
+
</td>
|
|
65
|
+
<td style="padding:0 5px 0 0" width="24">
|
|
66
|
+
<a href="https://www.linkedin.com/company/compta-cl%C3%A9mentine/" target="_blank" style="vertical-align: middle;"><img
|
|
67
|
+
src="https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_linkedin.png"
|
|
68
|
+
alt="LinkedIn"
|
|
69
|
+
style="width: 20px"></a>
|
|
70
|
+
</td>
|
|
71
|
+
<td style="padding:0 5px 0 0" width="24">
|
|
72
|
+
<a href="https://www.instagram.com/comptaclementine/" target="_blank" style="vertical-align: middle;"><img
|
|
73
|
+
src="https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_instagram.png"
|
|
74
|
+
alt="Instagram"
|
|
75
|
+
style="width: 20px"></a>
|
|
76
|
+
</td>
|
|
77
|
+
<td style="text-align: right; vertical-align: middle; color: #6E6E71" width="430">
|
|
78
|
+
<span>Télécharger l'app</span>
|
|
79
|
+
<a href="https://apps.apple.com/fr/app/clementine/id1119493780" target="_blank" style="vertical-align: middle; margin-left: 10px"><img
|
|
80
|
+
src="https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_appstore.png"
|
|
81
|
+
alt="App Store"
|
|
82
|
+
style="width: 20px"></a>
|
|
83
|
+
<a href="https://play.google.com/store/apps/details?id=com.clementine.myclementine&hl=fr" target="_blank" style="vertical-align: middle; margin-left: 10px"><img
|
|
84
|
+
src="https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_playstore.png"
|
|
85
|
+
alt="Play Store"
|
|
86
|
+
style="width: 20px"></a>
|
|
87
|
+
</td>
|
|
88
|
+
</tr>
|
|
89
|
+
<tr>
|
|
90
|
+
<td colspan="7" style="padding-top: 12px">
|
|
91
|
+
<span style="text-align: left; text-decoration: none; color: #A0A1A6; white-space: nowrap; float: left;">
|
|
92
|
+
Une question ? Découvrez votre <a href="https://www.compta-clementine.fr/aide/" style="color: #FF7E3C">centre d'aide</a>
|
|
93
|
+
</span>
|
|
94
|
+
<span style="text-align: right; text-decoration: none; color: #A0A1A6; white-space: nowrap; float: right;">
|
|
95
|
+
Jusqu’à 500€ avec notre <a href="https://www.compta-clementine.fr/parrainage/?utm_source=signature&utm_medium=email&utm_campaign=signature&utm_content=cta" style="color: #FF7E3C">programme de parrainage</a>
|
|
96
|
+
</span>
|
|
97
|
+
</td>
|
|
98
|
+
</tr>
|
|
99
|
+
</table>
|
|
100
|
+
</td>
|
|
101
|
+
</tr>
|
|
102
|
+
<% } else if(brandName === 'Pourcentage') { %>
|
|
103
|
+
<tr>
|
|
104
|
+
<td
|
|
105
|
+
style="clear:both; padding-top: 20px; font-size:17px; line-height:14px; color:#ADADAD; text-align: justify; font-family: Arial;"
|
|
106
|
+
colspan="4">
|
|
107
|
+
<table style="width: 100%" width="100%">
|
|
108
|
+
<tr>
|
|
109
|
+
<td style="padding:0 10px 0 0" width="120">
|
|
110
|
+
<a href="https://app.pourcentage.fr/" target="_blank" style="text-decoration: none; color: #6E6E71; white-space: nowrap;">
|
|
111
|
+
<img
|
|
112
|
+
src="https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_connect2.png"
|
|
113
|
+
style="vertical-align: text-top;"
|
|
114
|
+
width="20"
|
|
115
|
+
alt="Connexion"> Connexion
|
|
116
|
+
</a>
|
|
117
|
+
</td>
|
|
118
|
+
</table>
|
|
119
|
+
</td>
|
|
120
|
+
</tr>
|
|
121
|
+
<% } %>
|
|
122
|
+
`;
|
|
123
|
+
const signatureTemplate = exports.signatureTemplate = `<table
|
|
124
|
+
border="0"
|
|
125
|
+
cellpadding="0"
|
|
126
|
+
cellspacing="0"
|
|
127
|
+
width="850"
|
|
128
|
+
class="signatureClementine">
|
|
129
|
+
|
|
130
|
+
${logoClementine}
|
|
131
|
+
|
|
132
|
+
<tr style="background: #F4F8FB">
|
|
133
|
+
${avatar}
|
|
134
|
+
<td
|
|
135
|
+
class="infos"
|
|
136
|
+
style=" padding: 20px 0 20px 30px;font-size: 17px; font-family: Arial; color:#000"
|
|
137
|
+
width="290"
|
|
138
|
+
colspan="2">
|
|
139
|
+
<table
|
|
140
|
+
border="0"
|
|
141
|
+
cellpadding="0"
|
|
142
|
+
cellspacing="0"
|
|
143
|
+
width="290">
|
|
144
|
+
<tr>
|
|
145
|
+
<td width="290">
|
|
146
|
+
<p style="font-size: 17px; margin:0px 0; padding:0">
|
|
147
|
+
<strong><span style="color:<%= primaryColor %>; font-weight: bold;"><%= user?.firstname ?? '' %> <%= user?.lastname ?? '' %></span></strong>
|
|
148
|
+
</p>
|
|
149
|
+
|
|
150
|
+
<% if(roleSignature) { %>
|
|
151
|
+
<p style="font-size: 17px; margin:0px 0; padding:0">
|
|
152
|
+
<span style="color: #6E6E71; font-weight: bold;"><%= roleSignature %></span></p>
|
|
153
|
+
</p>
|
|
154
|
+
<% } %>
|
|
155
|
+
</td>
|
|
156
|
+
</tr>
|
|
157
|
+
</table>
|
|
158
|
+
|
|
159
|
+
<p style="margin:16px 0; color:#6E6E71; border-top: 2px solid #6E6E71; width: 100px; opacity: 0.2"><!-- --></p><p style="margin:0; padding:0px 0 4px; color:#6E6E71;"><%= user.roles.map((r) => r.idRoles).includes(22) || (user && user.isAll === true) ? 'Nos' : 'Mes' %> horaires :<br/><%= horaires %></p>
|
|
160
|
+
</td>
|
|
161
|
+
|
|
162
|
+
<td class="infos" style="padding: 20px 20px 20px 0px; font-size: 17px; font-family: Arial; color:#000; <%= !user.calendlyUrl ? 'vertical-align: top;' : '' %>"
|
|
163
|
+
width="370">
|
|
164
|
+
<p style="margin:0px 0; padding:2px 0; color:#6E6E71; padding-left: 10px">
|
|
165
|
+
<span style="float:right">Standard : <%= standardPhoneSignature %></span><br/>
|
|
166
|
+
<% if(phoneSignature && phoneSignature !== standardPhoneSignature) { %>
|
|
167
|
+
<span style="float:right">Ligne directe : <%- phoneSignature %></span><br/>
|
|
168
|
+
<% } %>
|
|
169
|
+
</p>
|
|
170
|
+
|
|
171
|
+
<p style="margin:20px 60px 0 0; padding:0px 0 4px; color:#6E6E71; text-align: right; height: 54px;">
|
|
172
|
+
<% if(user.calendlyUrl) { %>
|
|
173
|
+
<img
|
|
174
|
+
src="https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_rightArrow.png"
|
|
175
|
+
alt="Prenez rendez-vous ici !">
|
|
176
|
+
<% } %>
|
|
177
|
+
</p>
|
|
178
|
+
|
|
179
|
+
<p style="margin:0; padding:0px 0 4px; color:#6E6E71; text-align: right"><a href="https://www.smileyourpla.net/" style="display: inline-block; color:#6E6E71;" target="_blank"><img
|
|
180
|
+
src="https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_smileYourPlanet.png"
|
|
181
|
+
alt="Initiative Smile your planet" height="36"></a>
|
|
182
|
+
<% if(user.calendlyUrl) { %>
|
|
183
|
+
<a href="<%= user.calendlyUrl %>" style="display: inline-block; color:#6E6E71;" target="_blank"><img
|
|
184
|
+
src="https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_rdv_tel.png"
|
|
185
|
+
alt="Demande de rdv téléphonique"></a>
|
|
186
|
+
<% } %>
|
|
187
|
+
</p>
|
|
188
|
+
</td>
|
|
189
|
+
</tr>
|
|
190
|
+
|
|
191
|
+
${footer}
|
|
192
|
+
|
|
193
|
+
<tr>
|
|
194
|
+
<td
|
|
195
|
+
style="clear:both; padding-top: 20px; font-size:14px; line-height:18px; color:#ADADAD; text-align: justify; font-family: Arial;"
|
|
196
|
+
colspan="4">
|
|
197
|
+
Les informations contenues dans ce courrier électronique et ses pièces jointes sont confidentielles et couvertes par le secret professionnel. Si vous n'êtes pas le(s) destinataire(s) ou avez reçu ce courrier électronique par erreur, merci de bien vouloir supprimer l'email et d'en informer l'expéditeur dès que possible. Ce courrier électronique ne peut pas être divulgué, utilisé ou copié par quelqu'un d'autre que le(s) destinataire(s).
|
|
198
|
+
</td>
|
|
199
|
+
</tr>
|
|
200
|
+
</table>`;
|
|
201
|
+
//# sourceMappingURL=signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature.js","mappings":";;;;;AAAA,MAAMA,cAAc,GAAG;;;;;;;;;;;;aAAvB;AAcA,MAAMC,MAAM,GAAG;;;;;;;;;;;;;;UAAf;AAgBA,MAAMC,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAf;AA0FO,MAAMC,iBAAiB,WAAjBA,iBAAiB,GAAG;;;;;;;EAO/BH,cAAc;;;IAGZC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0DNC,MAAM;;;;;;;;;SApEH","names":["logoClementine","avatar","footer","signatureTemplate"],"sourceRoot":"","sources":["../../../../ts/utils/email/templates/signature.ts"],"sourcesContent":["const logoClementine = `<% if (brandName === 'Clementine') { %><tr>\n<td\ncolspan=\"3\"\nclass=\"logo\"\nstyle=\"\"\nwidth=\"850\">\n <img\n src=\"https://clementine-website.s3.eu-west-3.amazonaws.com/logo_2022.png\"\n alt=\"Logo\"\n height=\"32\"\n style=\"padding-bottom: 10px;\">\n</td>\n</tr><% } %>`;\n\nconst avatar = `<% if (!forceRole && user?.avatar?.token) { %>\n <td\n class=\"avatar\"\n style=\"text-align:center; padding: 20px 0 20px 20px; position: relative;\"\n width=\"100\">\n <p style=\"padding: 20px;background-image: url('https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_quotes.png');background-size: 26%;background-position: 81% -3%;background-repeat: no-repeat;\">\n <img\n style=\"max-height: 90px;max-width: 90px; border-radius: 100%; padding-top: 1Opx\"\n src=\"\n <%= hostS3 %>users/<%= user.id %>/<%= user.avatar.token %>\n \"\n />\n </p>\n </td>\n <% } %>`;\n\nconst footer = `<% if(brandName === 'Clementine') { %>\n <tr>\n <td\n style=\"clear:both; padding-top: 20px; font-size:17px; line-height:14px; color:#ADADAD; text-align: justify; font-family: Arial;\"\n colspan=\"4\">\n <table style=\"width: 100%\" width=\"100%\">\n <tr>\n <td style=\"padding:0 10px 0 0\" width=\"120\">\n <a href=\"https://app.compta-clementine.fr/\" target=\"_blank\" style=\"text-decoration: none; color: #6E6E71; white-space: nowrap;\">\n <img\n src=\"https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_connect2.png\"\n style=\"vertical-align: text-top;\"\n width=\"20\"\n alt=\"Connexion\"> Connexion\n </a>\n </td>\n <td style=\"padding:0 10px 0 0\" width=\"170\">\n <a href=\"mailto:<%= supportMail %>\" target=\"_blank\" style=\"text-decoration: none; color: #6E6E71; white-space: nowrap;\">\n <img\n src=\"https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_support2.png\"\n style=\"vertical-align: text-top;\"\n width=\"17\"\n alt=\"Support technique\"> Support technique\n </a>\n </td>\n <td style=\"padding:0 5px 0 0\" width=\"24\">\n <a href=\"https://www.youtube.com/channel/UCVnCpcLdRwuYBLvAphHsvig/\" target=\"_blank\" style=\"vertical-align: middle;\"><img\n src=\"https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_youtube.png\"\n alt=\"YouTube\"\n style=\"width: 20px\"></a>\n </td>\n <td style=\"padding:0 5px 0 0\" width=\"24\">\n <a href=\"https://www.linkedin.com/company/compta-cl%C3%A9mentine/\" target=\"_blank\" style=\"vertical-align: middle;\"><img\n src=\"https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_linkedin.png\"\n alt=\"LinkedIn\"\n style=\"width: 20px\"></a>\n </td>\n <td style=\"padding:0 5px 0 0\" width=\"24\">\n <a href=\"https://www.instagram.com/comptaclementine/\" target=\"_blank\" style=\"vertical-align: middle;\"><img\n src=\"https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_instagram.png\"\n alt=\"Instagram\"\n style=\"width: 20px\"></a>\n </td>\n <td style=\"text-align: right; vertical-align: middle; color: #6E6E71\" width=\"430\">\n <span>Télécharger l'app</span>\n <a href=\"https://apps.apple.com/fr/app/clementine/id1119493780\" target=\"_blank\" style=\"vertical-align: middle; margin-left: 10px\"><img\n src=\"https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_appstore.png\"\n alt=\"App Store\"\n style=\"width: 20px\"></a>\n <a href=\"https://play.google.com/store/apps/details?id=com.clementine.myclementine&hl=fr\" target=\"_blank\" style=\"vertical-align: middle; margin-left: 10px\"><img\n src=\"https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_playstore.png\"\n alt=\"Play Store\"\n style=\"width: 20px\"></a>\n </td>\n </tr>\n <tr>\n <td colspan=\"7\" style=\"padding-top: 12px\">\n <span style=\"text-align: left; text-decoration: none; color: #A0A1A6; white-space: nowrap; float: left;\">\n Une question ? Découvrez votre <a href=\"https://www.compta-clementine.fr/aide/\" style=\"color: #FF7E3C\">centre d'aide</a>\n </span>\n <span style=\"text-align: right; text-decoration: none; color: #A0A1A6; white-space: nowrap; float: right;\">\n Jusqu’à 500€ avec notre <a href=\"https://www.compta-clementine.fr/parrainage/?utm_source=signature&utm_medium=email&utm_campaign=signature&utm_content=cta\" style=\"color: #FF7E3C\">programme de parrainage</a>\n </span>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n <% } else if(brandName === 'Pourcentage') { %>\n <tr>\n <td\n style=\"clear:both; padding-top: 20px; font-size:17px; line-height:14px; color:#ADADAD; text-align: justify; font-family: Arial;\"\n colspan=\"4\">\n <table style=\"width: 100%\" width=\"100%\">\n <tr>\n <td style=\"padding:0 10px 0 0\" width=\"120\">\n <a href=\"https://app.pourcentage.fr/\" target=\"_blank\" style=\"text-decoration: none; color: #6E6E71; white-space: nowrap;\">\n <img\n src=\"https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_connect2.png\"\n style=\"vertical-align: text-top;\"\n width=\"20\"\n alt=\"Connexion\"> Connexion\n </a>\n </td>\n </table>\n </td>\n </tr>\n <% } %>\n`;\n\nexport const signatureTemplate = `<table\nborder=\"0\"\ncellpadding=\"0\"\ncellspacing=\"0\"\nwidth=\"850\"\nclass=\"signatureClementine\">\n\n${logoClementine}\n\n<tr style=\"background: #F4F8FB\">\n ${avatar}\n <td\n class=\"infos\"\n style=\" padding: 20px 0 20px 30px;font-size: 17px; font-family: Arial; color:#000\"\n width=\"290\"\n colspan=\"2\">\n <table\n border=\"0\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n width=\"290\">\n <tr>\n <td width=\"290\">\n <p style=\"font-size: 17px; margin:0px 0; padding:0\">\n <strong><span style=\"color:<%= primaryColor %>; font-weight: bold;\"><%= user?.firstname ?? '' %> <%= user?.lastname ?? '' %></span></strong>\n </p>\n\n <% if(roleSignature) { %>\n <p style=\"font-size: 17px; margin:0px 0; padding:0\">\n <span style=\"color: #6E6E71; font-weight: bold;\"><%= roleSignature %></span></p>\n </p>\n <% } %>\n </td>\n </tr>\n </table>\n\n <p style=\"margin:16px 0; color:#6E6E71; border-top: 2px solid #6E6E71; width: 100px; opacity: 0.2\"><!-- --></p><p style=\"margin:0; padding:0px 0 4px; color:#6E6E71;\"><%= user.roles.map((r) => r.idRoles).includes(22) || (user && user.isAll === true) ? 'Nos' : 'Mes' %> horaires :<br/><%= horaires %></p>\n </td>\n \n <td class=\"infos\" style=\"padding: 20px 20px 20px 0px; font-size: 17px; font-family: Arial; color:#000; <%= !user.calendlyUrl ? 'vertical-align: top;' : '' %>\"\n width=\"370\">\n <p style=\"margin:0px 0; padding:2px 0; color:#6E6E71; padding-left: 10px\">\n <span style=\"float:right\">Standard : <%= standardPhoneSignature %></span><br/>\n <% if(phoneSignature && phoneSignature !== standardPhoneSignature) { %>\n <span style=\"float:right\">Ligne directe : <%- phoneSignature %></span><br/>\n <% } %>\n </p>\n \n <p style=\"margin:20px 60px 0 0; padding:0px 0 4px; color:#6E6E71; text-align: right; height: 54px;\">\n <% if(user.calendlyUrl) { %>\n <img\n src=\"https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_rightArrow.png\"\n alt=\"Prenez rendez-vous ici !\">\n <% } %>\n </p>\n \n <p style=\"margin:0; padding:0px 0 4px; color:#6E6E71; text-align: right\"><a href=\"https://www.smileyourpla.net/\" style=\"display: inline-block; color:#6E6E71;\" target=\"_blank\"><img\n src=\"https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_smileYourPlanet.png\"\n alt=\"Initiative Smile your planet\" height=\"36\"></a>\n <% if(user.calendlyUrl) { %>\n <a href=\"<%= user.calendlyUrl %>\" style=\"display: inline-block; color:#6E6E71;\" target=\"_blank\"><img\n src=\"https://clementine-website.s3.eu-west-3.amazonaws.com/signaturemail_rdv_tel.png\"\n alt=\"Demande de rdv téléphonique\"></a>\n <% } %>\n </p>\n </td>\n </tr>\n \n ${footer}\n\n <tr>\n <td\n style=\"clear:both; padding-top: 20px; font-size:14px; line-height:18px; color:#ADADAD; text-align: justify; font-family: Arial;\"\n colspan=\"4\">\n Les informations contenues dans ce courrier électronique et ses pièces jointes sont confidentielles et couvertes par le secret professionnel. Si vous n'êtes pas le(s) destinataire(s) ou avez reçu ce courrier électronique par erreur, merci de bien vouloir supprimer l'email et d'en informer l'expéditeur dès que possible. Ce courrier électronique ne peut pas être divulgué, utilisé ou copié par quelqu'un d'autre que le(s) destinataire(s).\n </td>\n</tr>\n</table>`;"]}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.generateSignature = generateSignature;
|
|
7
|
+
|
|
8
|
+
var _dayjs = require("dayjs");
|
|
9
|
+
|
|
10
|
+
var dayjs = _interopRequireWildcard(_dayjs);
|
|
11
|
+
|
|
12
|
+
var _lodash = require("lodash");
|
|
13
|
+
|
|
14
|
+
var _Role = require("../types/Enum/Role");
|
|
15
|
+
|
|
16
|
+
var _brands = require("./brands");
|
|
17
|
+
|
|
18
|
+
var _signature = require("./email/templates/signature");
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
25
|
+
var t = {};
|
|
26
|
+
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
28
|
+
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
30
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
31
|
+
}
|
|
32
|
+
return t;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const ejs = require('ejs');
|
|
36
|
+
|
|
37
|
+
function intersection(arr) {
|
|
38
|
+
return arr.reduce((a, b) => a.filter(c => b.includes(c)), []);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getRoleSignature(user) {
|
|
42
|
+
if (user.positionLabel) return user.positionLabel;
|
|
43
|
+
const isStagiaireOrAlternant = user.roles.map(r => r.id).includes(_Role.Role.INTERN) || user.roles.map(r => r.id).includes(_Role.Role.ALTERNATE);
|
|
44
|
+
const isManager = user.roles.map(r => r.id).includes(_Role.Role.MANAGER);
|
|
45
|
+
const isSocial = user.roles.map(r => r.id).includes(_Role.Role.SOCIAL);
|
|
46
|
+
const isJuridic = user.roles.map(r => r.id).includes(_Role.Role.JURIDIC);
|
|
47
|
+
const isFacturation = user.roles.map(r => r.id).includes(_Role.Role.FACTURATION);
|
|
48
|
+
const isExpert = user.roles.map(r => r.id).includes(_Role.Role.EXPERT_ACCOUNTANT);
|
|
49
|
+
const isCS = user.roles.map(r => r.id).includes(_Role.Role.CUSTOMER_SUCCESS);
|
|
50
|
+
const isSales = user.roles.map(r => r.id).includes(_Role.Role.COMMERCIAL);
|
|
51
|
+
const isAdmin = user.roles.map(r => r.id).includes(_Role.Role.ADMIN);
|
|
52
|
+
const isFront = !!intersection([user.roles.map(r => r.id), [_Role.Role.FRONT_OFFICE, _Role.Role.FRONT_OFFICE_EXPRESS]]).length;
|
|
53
|
+
|
|
54
|
+
if (isSales && isManager) {
|
|
55
|
+
return 'Responsable commercial';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (isSales) {
|
|
59
|
+
return `Chargé${user.idCivility === 2 ? 'e' : ''} de clientèle`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (isCS && isManager) {
|
|
63
|
+
return 'Responsable de clientèle';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (isCS) {
|
|
67
|
+
return `Chargé${user.idCivility === 2 ? 'e' : ''} de clientèle`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (isFacturation && isStagiaireOrAlternant) {
|
|
71
|
+
return 'Assistant facturation';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (isFacturation && isManager) {
|
|
75
|
+
return 'Responsable facturation';
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (isFacturation) {
|
|
79
|
+
return `Chargé${user.idCivility === 2 ? 'e' : ''} de facturation`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (isJuridic && isStagiaireOrAlternant) {
|
|
83
|
+
return 'Assistant juridique';
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (isJuridic && isManager) {
|
|
87
|
+
return 'Responsable juridique';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (isJuridic) {
|
|
91
|
+
return 'Juriste';
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (isSocial && isStagiaireOrAlternant) {
|
|
95
|
+
return 'Assistant paie';
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (isSocial && isManager) {
|
|
99
|
+
return 'Responsable paie';
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (isSocial) {
|
|
103
|
+
return 'Gestionnaire de paie';
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (isExpert) {
|
|
107
|
+
return `Expert${user.idCivility === 2 ? 'e' : ''}-comptable`;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (isAdmin) {
|
|
111
|
+
return 'Développeur web';
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (isFront && isManager) return 'Responsable comptable';
|
|
115
|
+
if (isFront && isStagiaireOrAlternant) return 'Assistant comptable';
|
|
116
|
+
if (isFront) return `Comptable dédié${user.idCivility === 2 ? 'e' : ''}`;
|
|
117
|
+
return `Comptable dédié${user.idCivility === 2 ? 'e' : ''}`;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function getHoraires(user) {
|
|
121
|
+
if (!intersection([user.roles.map(r => r.id), [_Role.Role.FRONT_OFFICE, _Role.Role.FRONT_OFFICE_EXPRESS, _Role.Role.COMMERCIAL]]).length) return 'Du lundi au vendredi de 9h à 19h';
|
|
122
|
+
if (!user.workingSchedules.length) return 'Du lundi au vendredi de 9h à 19h';
|
|
123
|
+
let reducedSchedules = user.workingSchedules.reduce((acc, e, index) => {
|
|
124
|
+
const name = `${dayjs(e.morningStart, 'HH:mm:ss').format('HH:mm')}-${dayjs(e.afternoonEnd || e.morningEnd, 'HH:mm:ss').format('HH:mm')}`;
|
|
125
|
+
if (!acc[name]) acc[name] = [index];else acc[name].push(index);
|
|
126
|
+
return acc;
|
|
127
|
+
}, {});
|
|
128
|
+
reducedSchedules = (0, _lodash.orderBy)(reducedSchedules, elem => elem.length, ['desc']);
|
|
129
|
+
let resultHoraire = '';
|
|
130
|
+
let startH;
|
|
131
|
+
let startM;
|
|
132
|
+
let endH;
|
|
133
|
+
let endM;
|
|
134
|
+
let firstDayOfWeek;
|
|
135
|
+
let lastDayOfWeek;
|
|
136
|
+
reducedSchedules.forEach((schedule, index) => {
|
|
137
|
+
startH = dayjs(user.workingSchedules[schedule[0]].morningStart ? user.workingSchedules[schedule[0]].morningStart : user.workingSchedules[schedule[0]].afternoonStart, 'HH:mm:ss').get('hour');
|
|
138
|
+
startM = dayjs(user.workingSchedules[schedule[0]].morningStart ? user.workingSchedules[schedule[0]].morningStart : user.workingSchedules[schedule[0]].afternoonStart, 'HH:mm:ss').get('minute');
|
|
139
|
+
endH = dayjs(user.workingSchedules[schedule[0]].afternoonEnd || user.workingSchedules[schedule[0]].morningEnd, 'HH:mm:ss').get('hour');
|
|
140
|
+
endM = dayjs(user.workingSchedules[schedule[0]].afternoonEnd || user.workingSchedules[schedule[0]].morningEnd, 'HH:mm:ss').get('minute');
|
|
141
|
+
firstDayOfWeek = dayjs().locale('fr').day(user.workingSchedules[schedule[0]].idDay).format('dddd');
|
|
142
|
+
|
|
143
|
+
if (!index) {
|
|
144
|
+
// pour le premier index, on affiche l'amplitude horaire la plus commune, du XX au XX de Xh à Xh
|
|
145
|
+
lastDayOfWeek = dayjs().locale('fr').day(user.workingSchedules[user.workingSchedules.length - 1].idDay).format('dddd');
|
|
146
|
+
resultHoraire += `Du ${firstDayOfWeek} au ${lastDayOfWeek} de ${startH}h${startM > 0 ? startM : ''} à ${endH}h${endM > 0 ? endM : ''}`;
|
|
147
|
+
} else {
|
|
148
|
+
// Fonctionnel si uniquement un jour par semaine avec des horaires différents
|
|
149
|
+
resultHoraire += `<br/>Le ${firstDayOfWeek} de ${startH}h${startM > 0 ? startM : ''} à ${endH}h${endM > 0 ? endM : ''}`;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
return resultHoraire;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function getMailSignature(user, idTypeBrand) {
|
|
156
|
+
const informatiqueMail = (0, _brands.getBrandConfig)(Object.assign(Object.assign({}, idTypeBrand ? {
|
|
157
|
+
idTypeBrand
|
|
158
|
+
} : {}), {
|
|
159
|
+
objectWaited: 'listMails.informatique'
|
|
160
|
+
}));
|
|
161
|
+
const bonjourMail = (0, _brands.getBrandConfig)(Object.assign(Object.assign({}, idTypeBrand ? {
|
|
162
|
+
idTypeBrand
|
|
163
|
+
} : {}), {
|
|
164
|
+
objectWaited: 'listMails.bonjour'
|
|
165
|
+
}));
|
|
166
|
+
|
|
167
|
+
if (user.roles.map(r => r.id).includes(_Role.Role.ADMIN)) {
|
|
168
|
+
return informatiqueMail;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (user && !!intersection([user.roles.map(r => r.id), [_Role.Role.FRONT_OFFICE, _Role.Role.FRONT_OFFICE_EXPRESS, _Role.Role.COMMERCIAL]]).length) return user.email;
|
|
172
|
+
return bonjourMail;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function getPhoneSignature(user) {
|
|
176
|
+
if (user.phone !== '0383931414') {
|
|
177
|
+
return user.phone.replace(/\B(?=(\d{2})+(?!\d))/g, ' ');
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function generateSignature(params) {
|
|
184
|
+
const {
|
|
185
|
+
forceRole = null,
|
|
186
|
+
idTypeBrand = 1
|
|
187
|
+
} = params,
|
|
188
|
+
otherParams = __rest(params, ["forceRole", "idTypeBrand"]);
|
|
189
|
+
|
|
190
|
+
let {
|
|
191
|
+
user
|
|
192
|
+
} = otherParams;
|
|
193
|
+
const hostS3 = (0, _brands.getBrandConfig)({
|
|
194
|
+
idTypeBrand,
|
|
195
|
+
objectWaited: 'urlS3'
|
|
196
|
+
});
|
|
197
|
+
const brandName = (0, _brands.getBrandConfig)(Object.assign(Object.assign({}, idTypeBrand ? {
|
|
198
|
+
idTypeBrand
|
|
199
|
+
} : {}), {
|
|
200
|
+
objectWaited: 'name'
|
|
201
|
+
}));
|
|
202
|
+
const bonjourMail = (0, _brands.getBrandConfig)(Object.assign(Object.assign({}, idTypeBrand ? {
|
|
203
|
+
idTypeBrand
|
|
204
|
+
} : {}), {
|
|
205
|
+
objectWaited: 'listMails.bonjour'
|
|
206
|
+
}));
|
|
207
|
+
const socialMail = (0, _brands.getBrandConfig)(Object.assign(Object.assign({}, idTypeBrand ? {
|
|
208
|
+
idTypeBrand
|
|
209
|
+
} : {}), {
|
|
210
|
+
objectWaited: 'listMails.social'
|
|
211
|
+
}));
|
|
212
|
+
const supportMail = (0, _brands.getBrandConfig)(Object.assign(Object.assign({}, idTypeBrand ? {
|
|
213
|
+
idTypeBrand
|
|
214
|
+
} : {}), {
|
|
215
|
+
objectWaited: 'listMails.support'
|
|
216
|
+
}));
|
|
217
|
+
const juridiqueMail = (0, _brands.getBrandConfig)(Object.assign(Object.assign({}, idTypeBrand ? {
|
|
218
|
+
idTypeBrand
|
|
219
|
+
} : {}), {
|
|
220
|
+
objectWaited: 'listMails.juridique'
|
|
221
|
+
}));
|
|
222
|
+
const facturationMail = (0, _brands.getBrandConfig)(Object.assign(Object.assign({}, idTypeBrand ? {
|
|
223
|
+
idTypeBrand
|
|
224
|
+
} : {}), {
|
|
225
|
+
objectWaited: 'listMails.facturation'
|
|
226
|
+
}));
|
|
227
|
+
const primaryColor = (0, _brands.getBrandConfig)(Object.assign(Object.assign({}, idTypeBrand ? {
|
|
228
|
+
idTypeBrand
|
|
229
|
+
} : {}), {
|
|
230
|
+
objectWaited: 'colors.primary'
|
|
231
|
+
}));
|
|
232
|
+
const standardPhoneSignature = (0, _brands.getBrandConfig)(Object.assign(Object.assign({}, idTypeBrand ? {
|
|
233
|
+
idTypeBrand
|
|
234
|
+
} : {}), {
|
|
235
|
+
objectWaited: 'listPhones.contact'
|
|
236
|
+
}));
|
|
237
|
+
const juridiquePhoneSignature = (0, _brands.getBrandConfig)(Object.assign(Object.assign({}, idTypeBrand ? {
|
|
238
|
+
idTypeBrand
|
|
239
|
+
} : {}), {
|
|
240
|
+
objectWaited: 'listPhones.juridique'
|
|
241
|
+
}));
|
|
242
|
+
const socialPhoneSignature = (0, _brands.getBrandConfig)(Object.assign(Object.assign({}, idTypeBrand ? {
|
|
243
|
+
idTypeBrand
|
|
244
|
+
} : {}), {
|
|
245
|
+
objectWaited: 'listPhones.social'
|
|
246
|
+
}));
|
|
247
|
+
let roleSignature;
|
|
248
|
+
let mailSignature;
|
|
249
|
+
let phoneSignature;
|
|
250
|
+
let horaires;
|
|
251
|
+
[roleSignature, mailSignature, phoneSignature, horaires] = ['Expert-Comptable', bonjourMail, false, 'Du lundi au vendredi de 9h à 19h'];
|
|
252
|
+
|
|
253
|
+
if (!user) {
|
|
254
|
+
// Signature Clementine
|
|
255
|
+
user = {
|
|
256
|
+
firstname: `L'équipe ${brandName}`,
|
|
257
|
+
isAll: true
|
|
258
|
+
};
|
|
259
|
+
roleSignature = '';
|
|
260
|
+
} else if (forceRole === 'social') {
|
|
261
|
+
// Signature social
|
|
262
|
+
user = {
|
|
263
|
+
firstname: 'Service social',
|
|
264
|
+
isAll: true
|
|
265
|
+
};
|
|
266
|
+
mailSignature = socialMail;
|
|
267
|
+
roleSignature = '';
|
|
268
|
+
phoneSignature = socialPhoneSignature;
|
|
269
|
+
} else if (forceRole === 'support') {
|
|
270
|
+
// Signature support
|
|
271
|
+
user = {
|
|
272
|
+
firstname: 'Service Support',
|
|
273
|
+
isAll: true
|
|
274
|
+
};
|
|
275
|
+
mailSignature = supportMail;
|
|
276
|
+
roleSignature = null;
|
|
277
|
+
} else if (forceRole === 'juridique') {
|
|
278
|
+
// Signature juridique
|
|
279
|
+
user = {
|
|
280
|
+
firstname: 'Service juridique',
|
|
281
|
+
isAll: true
|
|
282
|
+
};
|
|
283
|
+
mailSignature = juridiqueMail;
|
|
284
|
+
roleSignature = null;
|
|
285
|
+
phoneSignature = juridiquePhoneSignature;
|
|
286
|
+
} else if (forceRole === 'facturation') {
|
|
287
|
+
// Signature facturation
|
|
288
|
+
user = {
|
|
289
|
+
firstname: 'Service facturation',
|
|
290
|
+
isAll: true
|
|
291
|
+
};
|
|
292
|
+
mailSignature = facturationMail;
|
|
293
|
+
roleSignature = null;
|
|
294
|
+
phoneSignature = standardPhoneSignature;
|
|
295
|
+
} else if (user !== 0) {
|
|
296
|
+
// Signature par défaut
|
|
297
|
+
roleSignature = getRoleSignature(user);
|
|
298
|
+
mailSignature = getMailSignature(user, idTypeBrand);
|
|
299
|
+
horaires = getHoraires(user);
|
|
300
|
+
phoneSignature = getPhoneSignature(user);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return ejs.render(_signature.signatureTemplate, {
|
|
304
|
+
forceRole,
|
|
305
|
+
brandName,
|
|
306
|
+
hostS3,
|
|
307
|
+
user,
|
|
308
|
+
roleSignature,
|
|
309
|
+
mailSignature,
|
|
310
|
+
phoneSignature,
|
|
311
|
+
standardPhoneSignature,
|
|
312
|
+
horaires,
|
|
313
|
+
primaryColor,
|
|
314
|
+
supportMail
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
//# sourceMappingURL=email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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IACAmF,cAAc,GAAGlB,iBAAiB,CAACjE,IAAD,CAAlC;EACD;;EAED,OAAOX,GAAG,CAACkG,MAAJ,CAAWC,4BAAX,EAA8B;IACnCnB,SADmC;IAEnCG,SAFmC;IAGnCD,MAHmC;IAInCvE,IAJmC;IAKnCiF,aALmC;IAMnCC,aANmC;IAOnCC,cAPmC;IAQnCL,sBARmC;IASnCM,QATmC;IAUnCP,YAVmC;IAWnCH;EAXmC,CAA9B,CAAP;AAaD","names":["generateSignature","dayjs","ejs","require","intersection","arr","reduce","a","b","filter","c","includes","getRoleSignature","user","positionLabel","isStagiaireOrAlternant","roles","map","r","id","Role","INTERN","ALTERNATE","isManager","MANAGER","isSocial","SOCIAL","isJuridic","JURIDIC","isFacturation","FACTURATION","isExpert","EXPERT_ACCOUNTANT","isCS","CUSTOMER_SUCCESS","isSales","COMMERCIAL","isAdmin","ADMIN","isFront","FRONT_OFFICE","FRONT_OFFICE_EXPRESS","length","idCivility","getHoraires","workingSchedules","reducedSchedules","acc","e","index","name","morningStart","format","afternoonEnd","morningEnd","push","elem","resultHoraire","startH","startM","endH","endM","firstDayOfWeek","lastDayOfWeek","forEach","schedule","afternoonStart","get","locale","day","idDay","getMailSignature","idTypeBrand","informatiqueMail","Object","objectWaited","bonjourMail","email","getPhoneSignature","phone","replace","params","forceRole","otherParams","hostS3","brandName","socialMail","supportMail","juridiqueMail","facturationMail","primaryColor","standardPhoneSignature","juridiquePhoneSignature","socialPhoneSignature","roleSignature","mailSignature","phoneSignature","horaires","firstname","isAll","render","signatureTemplate"],"sourceRoot":"","sources":["../../ts/utils/email.ts"],"sourcesContent":["import * as dayjs from 'dayjs';\nimport { orderBy as orderByLodash } from 'lodash';\nimport { Role } from '../types/Enum/Role';\nimport { getBrandConfig } from './brands';\nimport { signatureTemplate } from './email/templates/signature';\n\nconst ejs = require('ejs');\n\nfunction intersection<T>(arr: [T[], T[]]) { return arr.reduce((a: T[], b: T[]) => a.filter((c) => b.includes(c)), []); }\n\nfunction getRoleSignature(user:any) {\n if (user.positionLabel) return user.positionLabel;\n\n const isStagiaireOrAlternant = user.roles.map((r: any) => r.id).includes(Role.INTERN) || user.roles.map((r: any) => r.id).includes(Role.ALTERNATE);\n const isManager = user.roles.map((r: any) => r.id).includes(Role.MANAGER);\n\n const isSocial = user.roles.map((r: any) => r.id).includes(Role.SOCIAL);\n const isJuridic = user.roles.map((r: any) => r.id).includes(Role.JURIDIC);\n const isFacturation = user.roles.map((r: any) => r.id).includes(Role.FACTURATION);\n const isExpert = user.roles.map((r: any) => r.id).includes(Role.EXPERT_ACCOUNTANT);\n const isCS = user.roles.map((r: any) => r.id).includes(Role.CUSTOMER_SUCCESS);\n const isSales = user.roles.map((r: any) => r.id).includes(Role.COMMERCIAL);\n const isAdmin = user.roles.map((r: any) => r.id).includes(Role.ADMIN);\n const isFront = !!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS]]).length;\n\n if (isSales && isManager) { return 'Responsable commercial'; }\n if (isSales) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de clientèle`; }\n\n if (isCS && isManager) { return 'Responsable de clientèle'; }\n if (isCS) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de clientèle`; }\n\n if (isFacturation && isStagiaireOrAlternant) { return 'Assistant facturation'; }\n if (isFacturation && isManager) { return 'Responsable facturation'; }\n if (isFacturation) { return `Chargé${user.idCivility === 2 ? 'e' : ''} de facturation`; }\n\n if (isJuridic && isStagiaireOrAlternant) { return 'Assistant juridique'; }\n if (isJuridic && isManager) { return 'Responsable juridique'; }\n if (isJuridic) { return 'Juriste'; }\n\n if (isSocial && isStagiaireOrAlternant) { return 'Assistant paie'; }\n if (isSocial && isManager) { return 'Responsable paie'; }\n if (isSocial) { return 'Gestionnaire de paie'; }\n\n if (isExpert) { return `Expert${user.idCivility === 2 ? 'e' : ''}-comptable`; }\n\n if (isAdmin) { return 'Développeur web'; }\n\n if (isFront && isManager) return 'Responsable comptable';\n if (isFront && isStagiaireOrAlternant) return 'Assistant comptable';\n if (isFront) return `Comptable dédié${user.idCivility === 2 ? 'e' : ''}`;\n return `Comptable dédié${user.idCivility === 2 ? 'e' : ''}`;\n}\n\nfunction getHoraires(user:any) { // On affiche les horaires uniquement pour les front, et pas pour les TVA\n if (!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.COMMERCIAL]]).length) return 'Du lundi au vendredi de 9h à 19h';\n\n if (!user.workingSchedules.length) return 'Du lundi au vendredi de 9h à 19h';\n\n let reducedSchedules = user.workingSchedules.reduce((acc: any, e:any, index: number) => {\n const name = `${dayjs(e.morningStart, 'HH:mm:ss').format('HH:mm')}-${dayjs(e.afternoonEnd || e.morningEnd, 'HH:mm:ss').format('HH:mm')}`;\n if (!acc[name]) acc[name] = [index];\n else acc[name].push(index);\n return acc;\n }, {});\n\n reducedSchedules = orderByLodash(reducedSchedules, (elem) => elem.length, ['desc']);\n\n let resultHoraire = '';\n let startH;\n let startM;\n let endH;\n let endM;\n let firstDayOfWeek;\n let lastDayOfWeek;\n\n reducedSchedules.forEach((schedule: any, index: number) => {\n startH = dayjs(user.workingSchedules[schedule[0]].morningStart ? user.workingSchedules[schedule[0]].morningStart : user.workingSchedules[schedule[0]].afternoonStart, 'HH:mm:ss').get('hour');\n startM = dayjs(user.workingSchedules[schedule[0]].morningStart ? user.workingSchedules[schedule[0]].morningStart : user.workingSchedules[schedule[0]].afternoonStart, 'HH:mm:ss').get('minute');\n endH = dayjs(user.workingSchedules[schedule[0]].afternoonEnd || user.workingSchedules[schedule[0]].morningEnd, 'HH:mm:ss').get('hour');\n endM = dayjs(user.workingSchedules[schedule[0]].afternoonEnd || user.workingSchedules[schedule[0]].morningEnd, 'HH:mm:ss').get('minute');\n firstDayOfWeek = dayjs().locale('fr').day(user.workingSchedules[schedule[0]].idDay).format('dddd');\n if (!index) {\n // pour le premier index, on affiche l'amplitude horaire la plus commune, du XX au XX de Xh à Xh\n lastDayOfWeek = dayjs().locale('fr').day(user.workingSchedules[user.workingSchedules.length - 1].idDay).format('dddd');\n resultHoraire += `Du ${firstDayOfWeek} au ${lastDayOfWeek} de ${startH}h${startM > 0 ? startM : ''} à ${endH}h${endM > 0 ? endM : ''}`;\n } else { // Fonctionnel si uniquement un jour par semaine avec des horaires différents\n resultHoraire += `<br/>Le ${firstDayOfWeek} de ${startH}h${startM > 0 ? startM : ''} à ${endH}h${endM > 0 ? endM : ''}`;\n }\n });\n return resultHoraire;\n}\n\nfunction getMailSignature(user:any, idTypeBrand:number) {\n const informatiqueMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.informatique',\n }) as unknown as string;\n const bonjourMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.bonjour',\n }) as unknown as string;\n\n if (user.roles.map((r: any) => r.id).includes(Role.ADMIN)) { return informatiqueMail; }\n if (user && !!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.COMMERCIAL]]).length) return user.email;\n return bonjourMail;\n}\n\nfunction getPhoneSignature(user:any) {\n if (user.phone !== '0383931414') { return user.phone.replace(/\\B(?=(\\d{2})+(?!\\d))/g, ' '); }\n return false;\n}\n\nexport function generateSignature(params: any): string {\n const {\n forceRole = null, idTypeBrand = 1, ...otherParams\n } = params;\n let {\n user,\n } = otherParams;\n\n const hostS3 = getBrandConfig({\n idTypeBrand,\n objectWaited: 'urlS3',\n });\n\n const brandName = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'name',\n }) as unknown as string;\n const bonjourMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.bonjour',\n }) as unknown as string;\n const socialMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.social',\n }) as unknown as string;\n const supportMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.support',\n }) as unknown as string;\n const juridiqueMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.juridique',\n }) as unknown as string;\n const facturationMail = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listMails.facturation',\n }) as unknown as string;\n const primaryColor = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'colors.primary',\n }) as unknown as string;\n const standardPhoneSignature = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listPhones.contact',\n }) as unknown as string;\n const juridiquePhoneSignature = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listPhones.juridique',\n }) as unknown as string;\n const socialPhoneSignature = getBrandConfig({\n ...(idTypeBrand ? { idTypeBrand } : {}),\n objectWaited: 'listPhones.social',\n }) as unknown as string;\n\n let roleSignature: string | null;\n let mailSignature: string | null;\n let phoneSignature: string | boolean;\n let horaires: string | null;\n [roleSignature, mailSignature, phoneSignature, horaires] = ['Expert-Comptable', bonjourMail, false, 'Du lundi au vendredi de 9h à 19h'];\n\n if (!user) { // Signature Clementine\n user = {\n firstname: `L'équipe ${brandName}`,\n isAll: true,\n };\n roleSignature = '';\n } else if (forceRole === 'social') { // Signature social\n user = {\n firstname: 'Service social',\n isAll: true,\n };\n mailSignature = socialMail;\n roleSignature = '';\n phoneSignature = socialPhoneSignature;\n } else if (forceRole === 'support') { // Signature support\n user = {\n firstname: 'Service Support',\n isAll: true,\n };\n mailSignature = supportMail;\n roleSignature = null;\n } else if (forceRole === 'juridique') { // Signature juridique\n user = {\n firstname: 'Service juridique',\n isAll: true,\n };\n mailSignature = juridiqueMail;\n roleSignature = null;\n phoneSignature = juridiquePhoneSignature;\n } else if (forceRole === 'facturation') { // Signature facturation\n user = {\n firstname: 'Service facturation',\n isAll: true,\n };\n mailSignature = facturationMail;\n roleSignature = null;\n phoneSignature = standardPhoneSignature;\n } else if (user !== 0) { // Signature par défaut\n roleSignature = getRoleSignature(user);\n mailSignature = getMailSignature(user, idTypeBrand);\n horaires = getHoraires(user);\n phoneSignature = getPhoneSignature(user);\n }\n\n return ejs.render(signatureTemplate, {\n forceRole,\n brandName,\n hostS3,\n user,\n roleSignature,\n mailSignature,\n phoneSignature,\n standardPhoneSignature,\n horaires,\n primaryColor,\n supportMail,\n });\n}"]}
|
package/js/utils/index.js
CHANGED
|
@@ -100,6 +100,18 @@ Object.keys(_siretValidation).forEach(function (key) {
|
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
+
var _email = require("./email");
|
|
104
|
+
|
|
105
|
+
Object.keys(_email).forEach(function (key) {
|
|
106
|
+
if (key === "default" || key === "__esModule") return;
|
|
107
|
+
Object.defineProperty(exports, key, {
|
|
108
|
+
enumerable: true,
|
|
109
|
+
get: function () {
|
|
110
|
+
return _email[key];
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
103
115
|
var _prestation = require("./prestation");
|
|
104
116
|
|
|
105
117
|
Object.keys(_prestation).forEach(function (key) {
|
package/js/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":";;;;;;;;AAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA","names":[],"sourceRoot":"","sources":["../../ts/utils/index.ts"],"sourcesContent":["export * from './objectUtils';\nexport * from './stringUtils';\nexport * from './brands';\nexport * from './webmail';\nexport * from './decorators';\nexport * from './documents';\nexport * from './balanceSheetModule';\nexport * from './siretValidation';\nexport * from './prestation';\nexport * from './task';\nexport * from './social';\nexport * from './commercialManagement/document';\nexport * from './commercialManagement/recurrence';\nexport * from './amount';\nexport * from './quotation';"]}
|
|
1
|
+
{"version":3,"file":"index.js","mappings":";;;;;;;;AAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA","names":[],"sourceRoot":"","sources":["../../ts/utils/index.ts"],"sourcesContent":["export * from './objectUtils';\nexport * from './stringUtils';\nexport * from './brands';\nexport * from './webmail';\nexport * from './decorators';\nexport * from './documents';\nexport * from './balanceSheetModule';\nexport * from './siretValidation';\nexport * from './email';\nexport * from './prestation';\nexport * from './task';\nexport * from './social';\nexport * from './commercialManagement/document';\nexport * from './commercialManagement/recurrence';\nexport * from './amount';\nexport * from './quotation';"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.126",
|
|
4
4
|
"description": "Silex Core perform HTTP Request and object binding. Silex core helps developers to retrieve and return formatted object",
|
|
5
5
|
"homepage": "https://gitlab.compta-clementine.fr/dev/silex-api",
|
|
6
6
|
"main": "js/index.js",
|