Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
Flag cm in subject (#1601)
Browse files Browse the repository at this point in the history
* flag adult / racy content in email subject

* minor tweak

* tweak language

Co-authored-by: ngosset <ngosset@gmail.com>
  • Loading branch information
sastels and ngosset committed Feb 28, 2020
1 parent b9b5ef2 commit c5d0a50
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions f2/src/utils/encryptedEmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,15 @@ const encryptFile = (uid, emailAddress, data, sendMail) => {
else {
const attachment = fs.readFileSync(encryptedFile)
console.log('Encrypted File: File encrypted')
sendMail(emailAddress, attachment, data.reportId, 'Attachment')
if (file.isImageRacyClassified || file.isImageAdultClassified)
sendMail(
emailAddress,
attachment,
data.reportId,
'WARNING: potential offensive image',
)
else
sendMail(emailAddress, attachment, data.reportId, 'Attachment')
}
},
)
Expand Down Expand Up @@ -129,9 +137,9 @@ async function sendMail(emailAddress, attachment, reportId, emailType) {
const message = {
from: mailFrom,
to: emailAddress,
subject: `Report - reference number: ${reportId} ${emailType}`,
subject: `NCFRS - ref ${reportId} : ${emailType}`,
text: 'Plaintext version of the message',
html: 'pHTML version of the message/p',
html: 'HTML version of the message',
attachments: [
{
raw: attachment,
Expand Down

0 comments on commit c5d0a50

Please sign in to comment.