| 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 | 0 | 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 | 0 | final JammyjoesDatabase db = (JammyjoesDatabase) melati.getDatabase(); |
| 20 | |
|
| 21 | 0 | String name = Form.getFormNulled(context,"name"); |
| 22 | 0 | String email = Form.getFormNulled(context,"email"); |
| 23 | 0 | String website = Form.getFormNulled(context,"website"); |
| 24 | |
|
| 25 | 0 | String message = name + " would like to become a Jammy Joes Affiliate:\n\n"; |
| 26 | 0 | message += name + "\n"; |
| 27 | 0 | message += email + "\n\n"; |
| 28 | 0 | message += website + "\n\n"; |
| 29 | 0 | Email.send(db.getSettingTable().get(Email.SMTPSERVER), email, "timj@hoop.co.uk", "", "Jammy Joes Affiliate Signup", message); |
| 30 | |
|
| 31 | 0 | return "view/AffiliateSignedup.wm"; |
| 32 | |
} |
| 33 | |
|
| 34 | |
} |