I have already created a QR code in java. I want to send it as an email in an HTML template (img<src=???>). But I don't want to save that QR code image file on my disk.
Is there any way to put it as a byte array (or something like that...IDK) into an HTML template?
try {
QRCodeWriter qrCodeWriter = new QRCodeWriter();
BitMatrix bitMatrix = qrCodeWriter.encode(content, BarcodeFormat.QR_CODE, 450, 450);
File qrImg = new File("qr-code.png");
BufferedImage bfi = MatrixToImageWriter.toBufferedImage(bitMatrix);
ImageIO.write(bfi, "PNG", qrImg);
return qrImg;
} catch (IOException | WriterException e) {
throw new RuntimeException(e);
}