Package com.sahuaro.repositories

Examples of com.sahuaro.repositories.ContactRepository


    String telephone = (String) req.getParameter("telephone");
    String company = (String) req.getParameter("company");
    String msg = (String) req.getParameter("message");
   
    IProspectRepository prospectsRepo = new ProspectRepository();
    IContactRepository contactsRepo = new ContactRepository();
    IMessageRepository messagesRepo = new MessageRepository();
   
    //creates the prospect and saves it
    Prospect prospect = new Prospect(firstName, lastName, email);
    Key<Prospect> prospectKey = prospectsRepo.save(prospect);
    System.out.println("Prospect saved");
    //it get it back
   
   
    //creates the contact message
    Message message = new Message(msg, prospectKey.getId());
    Key<Message> messageKey = messagesRepo.save(message);
    System.out.println("Message saved");
    //get the message back to use the id
    Contact contact = new Contact(company, telephone, messageKey.getId());
    //saves the contact at Google servers
    Key<Contact> contactKey = contactsRepo.save(contact);
    System.out.println("Contact saved");
   
    //creates a new email container
    EmailSender<Contact> sender = new EmailSender<Contact>(contact);
    sender.sendEmail(email, msg, prospect);
View Full Code Here

TOP

Related Classes of com.sahuaro.repositories.ContactRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.