Package models.mailing

Examples of models.mailing.Mailing


        // Some votes on LT
        LightningTalk lt2 = new LightningTalk().save();
        new Vote(lt1, member, true).save();
        new Vote(lt2, member, true).save();
        // Recipient of mailings
        Mailing m1 = new Mailing();
        m1.actualRecipients.add(member);
        m1.actualRecipients.add(other1);
        m1.save();
        // Source of contact mailing
        Mailing m2 = new Mailing();
        m2.from = member;
        m2.save();
       
        assertNotNull(member.delete());
        assertNull(Member.findById(member.id));
        assertSame(other1, Member.findById(other1.id));
        assertSame(other2, Member.findById(other2.id));
View Full Code Here


        Logger.info("JobSendMailings : %d mailings en attente", pendings.size());
       
        // Pour chaque mailing en attente
        Iterator<Mailing> iPendingMailing = pendings.iterator();
        while (nbSends < dailyBatchSize && iPendingMailing.hasNext()) {
            final Mailing mailing = iPendingMailing.next();
           
            Set<Member> recipients = mailing.getPendingRecipients();
            Logger.info("JobSendMailings : %d membres en attente du mailing %s", recipients.size(), mailing);

            Iterator<Member> iRecipient = recipients.iterator();
            while (nbSends < dailyBatchSize && iRecipient.hasNext()) {
                final Member recipient = iRecipient.next();
               
                Logger.info("JobSendMailings : envoi du mailing %s au membre %s", mailing, recipient);
                Mails.mailing(mailing, recipient);
                mailing.addActualRecipient(recipient);
                nbSends++;
            }
           
            if (!iRecipient.hasNext()) {
                // Si nous avons épuisé tous les destinataires en attente
                // C'est que le mailing a été complètement envoyé
                mailing.status = MailingStatus.Sent;
                Logger.info("JobSendMailings : mailing %s complètement envoyé!", mailing);
            }
            mailing.save();
        }

        if (nbSends >= dailyBatchSize) {
            Logger.info("JobSendMailings : quota quotidien de %d envois atteint, on stoppe les envois", dailyBatchSize);
        }
View Full Code Here

        List<Mailing> mailings = Mailing.findAll();
        render(mailings);
    }
   
    public static void create() {
        render("Mailings/edit.html", new Mailing());
    }
View Full Code Here

    public static void create() {
        render("Mailings/edit.html", new Mailing());
    }
   
    public static void edit(long mailingId) {
        Mailing mailing = Mailing.findById(mailingId);
        render(mailing);
    }
View Full Code Here

        Mailing mailing = Mailing.findById(mailingId);
        render(mailing);
    }
   
    public static void show(long mailingId) {
        Mailing mailing = Mailing.findById(mailingId);
        render(mailing);
    }
View Full Code Here

        Mailing mailing = Mailing.findById(mailingId);
        render(mailing);
    }
   
    public static void preview(long mailingId) {
        Mailing mailing = Mailing.findById(mailingId);
        render("Mails/mailing.html", mailing);
    }
View Full Code Here

        flash.success("Mailing enregistré : %s", mailing);
        index();
    }
   
    public static void send(long mailingId) {
        Mailing mailing = Mailing.findById(mailingId);
        mailing.send();
        flash.success("La demande d'envoi du mailing \"%s\" a bien été enregistré. Il partira dans la nuit à un premier lot de destinataires.", mailing);
        index();
    }
View Full Code Here

        flash.success("La demande d'envoi du mailing \"%s\" a bien été enregistré. Il partira dans la nuit à un premier lot de destinataires.", mailing);
        index();
    }
   
    public static void delete(long mailingId) {
        Mailing mailing = Mailing.findById(mailingId);
        if (mailing.isUpdatable()) {
            mailing.delete();
            flash.success("Le mailing \"%s\" a été supprimé.", mailing);
        } else {
            flash.error("Le mailing \"%s\" ne peut pas être supprimé : son envoi a déjà commencé", mailing);
        }
        index();
View Full Code Here

    public static void kit() {
        render();
    }
   
    public static void contact() {
        Mailing email = new Mailing();
        email.from = Member.findByLogin(Security.connected());
        email.email = (email.from != null) ? email.from.email : null;
        render(email);
    }
View Full Code Here

TOP

Related Classes of models.mailing.Mailing

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.