-1
import java.io.Serializable;
import java.util.Locale;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
import org.apache.velocity.tools.generic.NumberTool;
import com.outjected.email.impl.templating.velocity.VelocityTemplate;
@Named
@RequestScoped
public class EnvioPedidoEmailBean implements Serializable {
private static final long serialVersionUID = 1L;
@Inject
private Mailer mailer;
@Inject
@PedidoEdicao
private Pedido pedido;
public void enviarPedido() {
MailMessage message = mailer.novaMensagem();
message.to(this.pedido.getCliente().getEmail())
.subject("Pedido " + this.pedido.getId())
.bodyHtml(new VelocityTemplate(getClass().getResourceAsStream("/emails/pedido.template")))
.put("pedido", this.pedido)
.put("numberTool", new NumberTool())
.put("locale", new Locale("pt", "BR"))
.send();
Dependency
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
<scope>compile</scope>
</dependency>
This error even continues to change the dependency version... Error on line 37:
.bodyHtml(new
VelocityTemplate(getClass().getResourceAsStream("/emails/pedido.template")))
That class
MailMessage
comes from which library?– Victor Stafusa
import com.outjected.email.api.Mailmessage;
– Frederico Queiroz