Skip to content

Commit

Permalink
change reaquest contact by mail template
Browse files Browse the repository at this point in the history
  • Loading branch information
clement-duport committed Jun 9, 2023
1 parent 7cb2304 commit 0ddac88
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ export class NotifyContactRequest extends TransactionalUseCase<ContactEstablishm
potentialBeneficiaryLastName:
payload.potentialBeneficiaryLastName,
potentialBeneficiaryEmail: payload.potentialBeneficiaryEmail,
immersionObject: payload.immersionObjective,
potentialBeneficiaryPhone: payload.potentialBeneficiaryPhone,
potentialBeneficiaryCvOrLinkedin:
payload.potentialBeneficiaryCvOrLinkedin,
message: payload.message,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ describe("NotifyContactRequest", () => {
payload.potentialBeneficiaryFirstName,
potentialBeneficiaryLastName: payload.potentialBeneficiaryLastName,
potentialBeneficiaryEmail: payload.potentialBeneficiaryEmail,
immersionObject: validEmailPayload.immersionObjective,
potentialBeneficiaryPhone:
validEmailPayload.potentialBeneficiaryPhone,
potentialBeneficiaryCvOrLinkedin:
validEmailPayload.potentialBeneficiaryCvOrLinkedin,
message: validEmailPayload.message,
},
cc: contact.copyEmails,
Expand Down
3 changes: 3 additions & 0 deletions front/src/app/pages/admin/EmailPreviewTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ export const defaultEmailValueByEmailKind: {
potentialBeneficiaryFirstName: "POTENTIAL_BENEFICIARY_FIRST_NAME",
potentialBeneficiaryLastName: "POTENTIAL_BENEFICIARY_LAST_NAME",
potentialBeneficiaryEmail: "POTENTIAL_BENEFICIARY_EMAIL",
immersionObject: "IMMERSION_OBJECT",
potentialBeneficiaryPhone: "POTENTIAL_BENEFICIARY_PHONE",
potentialBeneficiaryCvOrLinkedin: "POTENTIAL_BENEFICIARY_CV_OR_LINKEDIN",
message: "MESSAGE",
},
CONTACT_BY_PHONE_INSTRUCTIONS: {
Expand Down
3 changes: 3 additions & 0 deletions shared/src/email/EmailParamsByEmailType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ export type EmailParamsByEmailType = {
potentialBeneficiaryFirstName: string;
potentialBeneficiaryLastName: string;
potentialBeneficiaryEmail: string;
potentialBeneficiaryPhone: string;
immersionObject: string;
potentialBeneficiaryCvOrLinkedin?: string;
message: string;
};
CONTACT_BY_PHONE_INSTRUCTIONS: {
Expand Down
38 changes: 31 additions & 7 deletions shared/src/email/emailTemplatesByName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -799,21 +799,45 @@ export const emailTemplatesByName =
potentialBeneficiaryLastName,
appellationLabel,
businessName,
immersionObject,
potentialBeneficiaryPhone,
potentialBeneficiaryCvOrLinkedin,
message,
}) => ({
subject: `${potentialBeneficiaryFirstName} ${potentialBeneficiaryLastName} vous contacte pour une demande d'immersion sur le métier de ${appellationLabel}`,
greetings: `Bonjour ${contactFirstName} ${contactLastName},`,
content: `
${potentialBeneficiaryFirstName} ${potentialBeneficiaryLastName} vous écrit :
${message}
Un candidat souhaite faire une immersion pour ${immersionObject} sur le métier de ${appellationLabel} dans votre entreprise ${businessName}.
L'immersion souhaitée porte sur le métier de ${appellationLabel} dans votre entreprise ${businessName}.
voici son message:
<strong>Sa candidature vous intéresse ? Voici les étapes à suivre :</strong>
- Préparez votre échange grâce à notre <a href="https://aide.immersion-facile.beta.gouv.fr/fr/article/etudier-une-demande-dimmersion-professionnelle-1ehkehm/">page d'aide</a>.
- Prenez contact avec le candidat : <a href="mailto:${potentialBeneficiaryEmail}?subject=Suite à votre demande d'immersion chez ${businessName}">${potentialBeneficiaryEmail}</a>
"${message}"
${potentialBeneficiaryFirstName}
${potentialBeneficiaryLastName}
${
potentialBeneficiaryCvOrLinkedin &&
`Plus d'info sur ce candidat: <a href="${potentialBeneficiaryCvOrLinkedin}">${potentialBeneficiaryCvOrLinkedin}</a>`
}
<strong>Sa candidature vous intéresse ? </strong>
Prenez contact avec le candidat par email ou par téléphone:
`,
subContent: defaultSignature("immersion"),
buttons: [
{
label: `${potentialBeneficiaryEmail}`,
url: `mailto:${potentialBeneficiaryEmail}?subject=Suite à votre demande d'immersion chez ${businessName}`,
},
{
label: `${potentialBeneficiaryPhone}`,
url: `tel:${potentialBeneficiaryPhone}`,
},
],
subContent: `Vous pouvez préparer votre échange grâce à notre <a href="https://aide.immersion-facile.beta.gouv.fr/fr/article/etudier-une-demande-dimmersion-professionnelle-1ehkehm/">page d'aide</a>.
${defaultSignature("immersion")}`,
}),
},
CONTACT_BY_PHONE_INSTRUCTIONS: {
Expand Down

0 comments on commit 0ddac88

Please sign in to comment.