Skip to content

Commit

Permalink
chore(con): update emails (#1002)
Browse files Browse the repository at this point in the history
* Update calendar link for mentors in Germany

* Fix typo in the checkbox name on TP

* Update the styling in the mentorship-decline-email

* Add menteeApplicationText to the mentorship-request-email

* Add truncation to the mentee application text in the mentorship-request-email
  • Loading branch information
katamatata authored Dec 12, 2024
1 parent 75ba35b commit fac47b8
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@
>They provided the following reason and message for you:</mj-text
>

<mj-text mj-class="text paragraph"
><em>${reasonForDecline}</em></mj-text
>
<mj-text mj-class="text paragraph"
><em>${optionalMessageToMentee}</em></mj-text
>
<mj-text mj-class="text quote">${reasonForDecline}</mj-text>
<mj-text mj-class="text quote">${optionalMessageToMentee}</mj-text>

<mj-text mj-class="text paragraph"
<mj-text mj-class="text paragraph" padding="20px 0"
>Even if this match did not work out, we still have many amazing
mentors waiting for your application. So please have a look and
apply to another mentor who might be an even better match for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@
>They provided the following reason and message for you:</mj-text
>

<mj-text mj-class="text paragraph"
><em>${reasonForDecline}</em></mj-text
>
<mj-text mj-class="text paragraph"
><em>${optionalMessageToMentee}</em></mj-text
>
<mj-text mj-class="text quote">${reasonForDecline}</mj-text>
<mj-text mj-class="text quote">${optionalMessageToMentee}</mj-text>

<mj-text mj-class="text paragraph"
<mj-text mj-class="text paragraph" padding="20px 0"
>Even if this match did not work out, we still have many amazing
mentors waiting for your application. So please have a look and
apply to another mentor who might be an even better match for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
<mj-text mj-class="text paragraph"
>You have received a mentee application from
<strong>${menteeFullName}</strong> from
<strong>ReDI ${locationNameFormatted}</strong>!
<strong>ReDI ${locationNameFormatted}</strong>! Here is a message
from them:
</mj-text>
<mj-text mj-class="text paragraph"
<mj-text mj-class="text quote">${menteeApplicationText}</mj-text>
<mj-text mj-class="text" padding="20px 0"
>Please log into ReDI Connect to review this application and visit
the profile of the mentee at your earliest convenience:</mj-text
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
<mj-text mj-class="text paragraph"
>You have received a mentee application from
<strong>${menteeFullName}</strong> from
<strong>ReDI ${locationNameFormatted}</strong>!
<strong>ReDI ${locationNameFormatted}</strong>! Here is a message
from them:
</mj-text>
<mj-text mj-class="text paragraph"
<mj-text mj-class="text quote">${menteeApplicationText}</mj-text>
<mj-text mj-class="text" padding="20px 0"
>Please log into ReDI Connect to review this application and visit
the profile of the mentee at your earliest convenience:</mj-text
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ export class ConMentorshipMatchesService {
menteeFullName: menteeProfile.props.fullName,
menteeRediLocation: menteeProfile.props.rediLocation,
rediLocation: mentorProfile.props.rediLocation,
applicationText: input.applicationText,
})

return result
Expand Down
9 changes: 9 additions & 0 deletions apps/nestjs-api/src/email/lib/email/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,19 @@ export const sendMentorshipRequestReceivedEmail = ({
menteeFullName,
menteeRediLocation,
rediLocation,
applicationText,
}) => {
const truncateText = (text, maxLength) => {
return text.length > maxLength ? `${text.slice(0, maxLength)}...` : text
}

const truncatedApplicationText = truncateText(applicationText, 250)

const applicationsPageUrl = `${buildFrontendUrl(
process.env.NODE_ENV,
rediLocation
)}/app/applications`

const sendMentorshipRequestReceivedEmailParsed = convertTemplateToHtml(
rediLocation,
'mentorship-request-email'
Expand All @@ -436,6 +444,7 @@ export const sendMentorshipRequestReceivedEmail = ({
.replace(/\${mentorName}/g, mentorName)
.replace(/\${menteeFullName}/g, menteeFullName)
.replace(/\${applicationsPageUrl}/g, applicationsPageUrl)
.replace(/\${menteeApplicationText}/g, truncatedApplicationText)
return sendMjmlEmailFactory({
to: recipient,
subject: `You have received an application from ${menteeFullName}!`,
Expand Down

0 comments on commit fac47b8

Please sign in to comment.