1 package org.paneris.jammyjoes.controller; 2 3 4 import org.melati.Melati; 5 import org.melati.servlet.Form; 6 import org.melati.template.ServletTemplateContext; 7 import org.melati.util.Email; 8 import org.paneris.jammyjoes.model.JammyjoesDatabase; 9 import org.paneris.jammyjoes.servlet.JammyJoesMelatiServlet; 10 11 12 public class AffiliateSignup extends JammyJoesMelatiServlet { 13 14 private static final long serialVersionUID = 1L; 15 16 protected String jammyjoesRequest(Melati melati, ServletTemplateContext context) 17 throws Exception { 18 19 final JammyjoesDatabase db = (JammyjoesDatabase) melati.getDatabase(); 20 21 String name = Form.getFormNulled(context,"name"); 22 String email = Form.getFormNulled(context,"email"); 23 String website = Form.getFormNulled(context,"website"); 24 25 String message = name + " would like to become a Jammy Joes Affiliate:\n\n"; 26 message += name + "\n"; 27 message += email + "\n\n"; 28 message += website + "\n\n"; 29 Email.send(db.getSettingTable().get(Email.SMTPSERVER), email, "timj@hoop.co.uk", "", "Jammy Joes Affiliate Signup", message); 30 31 return "view/AffiliateSignedup.wm"; 32 } 33 34 }