<%@ taglib uri="http://www.entplace.com/taglibs/ep" prefix="ep" %> <%@ page import="com.synaptic.web.FormBase" %> <%@ page import="com.entplace.data.entities.User" %> <%@ page import="com.entplace.data.entities.merger.ForSale" %> <%@ page import="com.entplace.data.entities.merger.ForSaleHome" %> <%@ page import="com.entplace.data.entities.merger.Buyer" %> <%@ page import="com.entplace.data.entities.merger.BuyerHome" %> <% String action = form.getValue("_action"); boolean isMember = user != null; String type = nodeRequest.pathString(0); int adId = nodeRequest.pathInt(1); String host = request.getHeader("host"); ForSale forsaleAD = null; Buyer wantedAD = null; String caption = ""; String cc = ""; if ("buyers".equals(type)) { forsaleAD = ForSaleHome.getInstance().findByPrimaryKey(adId); caption = forsaleAD.getCaption().toUpperCase(); } else { wantedAD = BuyerHome.getInstance().findByPrimaryKey(adId); caption = wantedAD.getCaption().toUpperCase(); } String subject = "Business For Sale: " + caption; String prefix = "Hi,\nI saw this ad on MergerPlace.com and thought you might be\ninterested in checking it out. To view the ad, click on\nhttp://" + host + "/mp/redirect/" + type + "/view/" + adId + "\n\n "; %> <% if ("submit".equals(action)) { %>  
Your message has been sent.
<% if (!isMember) { %>  
Registered members of MergerPlace view listings placed on this site 7 days earlier than non members. Registration is quick, easy and FREE!
 
Please take a few moments to register and begin enjoying all the benifits of membership of MergerPlace and the Entrepreneur's Place community of business websites.
 
Thank You,
staff@mergerplace.com  
 
Advantages of Membership REGISTER NOW!

<% } else { %>  
Thank You.
<% } return; } %> <% form.setAttrs("fromName", "size=35 maxlength=50"); form.setAttrs("to", "size=35 maxlength=40"); form.setAttrs("from", "size=35 maxlength=40"); form.setAttrs("message", "rows=\"10\" cols=\"51\""); form.setAttrs("subject", "size=50 maxlength=80"); if (user != null) { String name = user.getFirstName(); if (!"".equals(name)) { name += " "; } name += user.getLastName(); form.setValue("fromName", name); form.setValue("from", user.getEmail()); } form.setValue("subject", subject); form.setValue("cc", "y"); %>  
EMAIL THIS AD TO A FRIEND:
 
<%= caption %> #<%= adId %>

 
Indicates REQUIRED Information
Friend's Email Address: <%= form.text("to") %>
(Send to multiple friends by separating email addresses with a comma)
 
Your Name <%= form.text("fromName") %>
Your Email Address: <%= form.text("from") %>
Send me a copy: <%= form.checkbox("cc", "y") %>
 
Email Subject: <%= form.text("subject") %>
Your personal message: <%= form.textarea("message") %>
 
Send Message