public class EmailUser
extends javax.servlet.http.HttpServlet
| Modifier and Type | Field and Description |
|---|---|
private static long |
serialVersionUID
The class' serialization version id.
|
| Constructor and Description |
|---|
EmailUser() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addTemplateValues(org.apache.velocity.VelocityContext content,
java.lang.String values)
Parses values passed from the backend and places them into the email
content data.
|
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles HTTP GET requests.
|
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles HTTP POST requests.
|
protected boolean |
isValidOrder(java.lang.String userid,
java.lang.String type,
java.lang.String orderref,
java.lang.String orderid,
Order order)
Answers if the email request is for a valid order or quote.
|
protected boolean |
sendEmail(ThreadServletContext ctx,
java.lang.String type,
java.lang.String ref,
java.lang.String shipNum,
Order order,
java.lang.String values,
boolean copyReps,
boolean debug)
Sends email to the address specified by the user object.
|
protected boolean |
setOrderConfirmationCC(ThreadServletContext ctx,
Order order,
FlashMailMessage email)
Sets the CC (or BCC) recipients for an order confirmation.
|
protected boolean |
setOrderConfirmationData(ThreadServletContext ctx,
org.apache.velocity.VelocityContext content,
Order order)
Sets additional email content data for an order confirmation.
|
protected boolean |
setShipConfirmationData(ThreadServletContext ctx,
org.apache.velocity.VelocityContext content,
Order order,
java.lang.String shipNum)
Sets additional email content data for a shipment confirmation.
|
protected void |
updateOrderAudit(ThreadServletContext ctx,
java.lang.String type,
java.lang.String ref,
java.lang.String orderId)
Updates confirmation timestamp and order id in audit record, only for order
and quote confirmations.
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, serviceprivate static final long serialVersionUID
public void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException,
javax.servlet.ServletException
doGet in class javax.servlet.http.HttpServletrequest - (HttpServletRequest) The servlet's incoming request.response - (HttpServletResponse) The servlet's outgoing response.java.io.IOException - - if an error occurs while processing the
request or response.javax.servlet.ServletException - - if an error occurs while
processing the request or response.public void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException,
javax.servlet.ServletException
doPost in class javax.servlet.http.HttpServletrequest - (HttpServletRequest) The servlet's incoming request.response - (HttpServletResponse) The servlet's outgoing response.java.io.IOException - - if an error occurs while processing the
request or response.javax.servlet.ServletException - - if an error occurs while
processing the request or response.protected void addTemplateValues(org.apache.velocity.VelocityContext content,
java.lang.String values)
content - (VelocityContext) The email content object.values - (String) The values passed from backend containing data
in the form: tag1=value1:tag2=value2:...protected boolean isValidOrder(java.lang.String userid,
java.lang.String type,
java.lang.String orderref,
java.lang.String orderid,
Order order)
throws java.lang.Exception
true if the order/quote is deemed valid,
otherwise false.java.lang.Exception - - if an error occurs while validating the
order/quote.protected boolean sendEmail(ThreadServletContext ctx, java.lang.String type, java.lang.String ref, java.lang.String shipNum, Order order, java.lang.String values, boolean copyReps, boolean debug) throws java.lang.Exception
ctx - (ThreadServletContext) The current context.type - (String) The type of confirmation being sent.ref - (String) The unique Flash assigned reference number for
the order.shipNum - (String) The shipment number for shipping confirmations.order - (Order) The order created by the backend system.values - (String) Template tag values passed from backend.copyReps - (boolean) Flag to stop sales reps from being copied.debug - (boolean) The debug flag.true if the email was send without error,
otherwise false.java.lang.Exception - - if an error occurs while sending the
email.protected boolean setOrderConfirmationCC(ThreadServletContext ctx, Order order, FlashMailMessage email) throws java.lang.Exception
ctx - (ThreadServletContext) The current context.order - (Order) The order for the confirmation.email - (FlashMailMessage) The order confirmation.true success or false failure.java.lang.Exception - - if an error occurs during processing.protected boolean setOrderConfirmationData(ThreadServletContext ctx, org.apache.velocity.VelocityContext content, Order order)
ctx - (ThreadServletContext) The current context.content - (VelocityContext) The email content object.order - (Order) The order for the confirmation.true success or false failure.protected boolean setShipConfirmationData(ThreadServletContext ctx, org.apache.velocity.VelocityContext content, Order order, java.lang.String shipNum)
ctx - (ThreadServletContext) The current context.content - (VelocityContext) The email content object.order - (Order) The order for the confirmation.shipNum - (String) Then shipment number for the shipment.true success or false failure.protected void updateOrderAudit(ThreadServletContext ctx, java.lang.String type, java.lang.String ref, java.lang.String orderId)
ctx - (ThreadServletContext) The current context.type - (String) The type of confirmation being processed.ref - (String) The unique Flash assigned reference number for
the order.orderId - (String) The backend assigned order number.