Skip to content
Snippets Groups Projects

Feedback

Users can send a feedback in the application, the feedback's receiver is defined in the FeedbackModal component

Add mail attachments

The user has the possibility to add an image to a feedback.

The email information are created in the sendEmail function and the mailData respects this scheme :

const mailData = {
  mode: "from",
  to: [{ name: "Support", email: "receiver-email" }],
  subject: "Your subject",
  parts: [{ type: "text/plain", body: mailContent }],
  attachments: [{ filename: "test.png", content: "base64file" }],
};

It is important that your file is sent base64 encoded to the sendmail job and with the data...base64 headers removed, otherwise it will be unreadable. In order to do this, we use a reader to read the file as Data URL

reader.readAsDataURL(file);

and then apply to the result so we send only the encoded part without its headers.

split(",")[1];