Package org.encuestame.persistence.domain

Examples of org.encuestame.persistence.domain.Email


    public UnitEmails createEmail(final UnitEmails unitEmails) throws EnMeExpcetion{
        if(unitEmails!= null){
            try {//
                final EmailList emailList = new EmailList();
                final String codeSubscribe = MD5Utils.md5(String.valueOf(System.currentTimeMillis()));
                final Email emailsDomain = new Email();
                emailsDomain.setEmail(unitEmails.getEmailName());
                emailsDomain.setSubscribed(Boolean.FALSE); //By Default is FALSE, user need subscribe.
                emailsDomain.setIdListEmail(emailList);
                getEmailListsDao().saveOrUpdate(emailsDomain);
                unitEmails.setIdEmail(emailsDomain.getIdEmail());
                //TODO: Necesitamos crear el registro con el hash !!
                final EmailSubscribe subscribe = new EmailSubscribe();
                subscribe.setEmail(emailsDomain);
                subscribe.setList(emailList);
                subscribe.setHashCode(codeSubscribe);
                getEmailListsDao().saveOrUpdate(subscribe);
                if (EnMePlaceHolderConfigurer.getBooleanProperty("application.email.enabled")) {
                    getMailService().send(emailsDomain.getEmail(),"Invitation to Subscribe Encuestame List","Invitation to Subscribe");
                }
                //TODO:Enviamos correo al usuario para que confirme su subscripcion.
            }
            catch (Exception e) {
                throw new EnMeExpcetion(e);
View Full Code Here


    public Boolean subscribeEmails(final String subscriptionCode, final String subscriptionOption) throws EnMeExpcetion{
        Boolean success = false;
        EmailSubscribe subscribe = getEmailListsDao().getSubscribeAccount(subscriptionCode);
        if (subscribe!=null){
            try {
                   Email emails = new Email();
                   if(subscriptionOption.equals("subscribe"))
                   {
                       emails.setSubscribed(Boolean.TRUE);
                   }
                   else {
                       emails.setSubscribed(Boolean.FALSE);
                   }
                   success = Boolean.TRUE;
                }
            catch (Exception e) {
                 throw new EnMeExpcetion(e);
View Full Code Here

     * @return
     */
    public Email createEmails(
                final String email,
                final EmailList list){
            final Email emails = new Email();
            emails.setEmail(email);
            emails.setIdListEmail(list);
            getCatEmailDao().saveOrUpdate(emails);
         return emails;
    }
View Full Code Here

     /**
      * Test Email Catalog.
      **/
     @Test
     public void testCatEmail(){
         final Email email = new Email();
         email.setEmail("paola@jotadeveloper.com");
         email.setIdListEmail(createDefaultListEmail());
         email.setSubscribed(Boolean.TRUE);
         email.setCreated_at(new Date());
         email.setEmailAccount("juan@encuestame.org");
         getCatEmailDao().saveOrUpdate(email);
         assertNotNull(email.getIdEmail());
     }
View Full Code Here

     */
    @Test
  public void testEmailSubscribe() {
    final EmailSubscribe subscribe = new EmailSubscribe();
    final EmailList emailList = createListEmails(this.initAccount, "VIP Email List", new Date());
    final Email email = createEmails("juan@encuestame.org", emailList);
    subscribe.setHashCode("CKDpka8834s");
    //subscribe.setIdSubscribe(5L);
    subscribe.setList(emailList);
    subscribe.setEmail(email);
    getCatEmailDao().saveOrUpdate(subscribe);
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.Email

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.