Olá,
Estou com o seguinte problema…
Quando preencho os dados textarea e envio por email, o texto esta chegando tudo na mesma linha, não esta respeitando a quebra de linha.
Como posso resolver isso?
@Public @Post ({"/xxx/xxx/xx"})
public void XXXX(String name, String message, String emails) {
String resp = "error";
try {
Indication indication = new Indication();
indication.setName(name);
Language language = null;
String subject = "Il tuo amico %%name%% raccomanda";
subject = subject.replaceAll("%%name%%", name);
for (String email : emails.split(",")) {
if (!email.trim().isEmpty()) {
MailMessage mail = new MailMessage(subject, email.trim(), message);
mailSender.send(mail);
indication.addEmail(email);
}
}
indicationDAO.save(indication);
resp = "ok";
} catch (Exception e) {
System.out.println("e " + e);
}
result.use(http()).body(""+resp+"");
}
At,