Package hudson.tasks

Examples of hudson.tasks.MailMessageIdAction


                            context.getListener().getLogger().println("Failed after second try sending email");
                            break;
                        }
                    }
                    if (context.getBuild().getAction(MailMessageIdAction.class) == null) {
                        context.getBuild().addAction(new MailMessageIdAction(msg.getMessageID()));
                    }
                } else {
                    context.getListener().getLogger().println("Email sending was cancelled"
                            + " by user script.");
                }
View Full Code Here


        }

        AbstractBuild<?, ?> pb = getPreviousBuild(context.getBuild(), context.getListener());
        if (pb != null) {
            // Send mails as replies until next successful build
            MailMessageIdAction b = pb.getAction(MailMessageIdAction.class);
            if (b != null && pb.getResult() != Result.SUCCESS) {
                debug(context.getListener().getLogger(), "Setting In-Reply-To since last build was not successful");
                msg.setHeader("In-Reply-To", b.messageId);
                msg.setHeader("References", b.messageId);
            }
View Full Code Here

                @Override
                public boolean shouldTriggerBuild(AbstractBuild build, TaskListener listener,
                                                  List<Action> actions) {
                    // Trigger for ODD build number
                    if (build.getNumber() % 2 == 1) {
                        actions.add(new MailMessageIdAction("foo"));
                        return true;
                    }
                    return false;
                }
            });
View Full Code Here

    String body = compileJelly(context,
        "prebuild_email_body.jelly");
 
    try {
      MimeMessage message = sendMail(master, subject, body, listener);
      build.addAction(new MailMessageIdAction(message.getMessageID()));
    } catch (Exception e) {
      e.printStackTrace(listener.error(e.getMessage()));
      return false;
    }
    return true;
View Full Code Here

    message.setRecipients(
        Message.RecipientType.TO, getRecipients(build, listener));
    message.setSubject(subject);
    message.setText(body, "iso-8859-1", "html");
   
    MailMessageIdAction action = build.getAction(MailMessageIdAction.class);
    if (action != null) {
      String messageId = action.messageId;
      message.setHeader("In-Reply-To", messageId);
      message.setHeader("References", messageId);
    }
View Full Code Here

        }
        msg.setRecipients(Message.RecipientType.TO, rcp.toArray(new InternetAddress[rcp.size()]));

        AbstractBuild<?, ?> pb = build.getPreviousBuild();
        if(pb!=null) {
            MailMessageIdAction b = pb.getAction(MailMessageIdAction.class);
            if(b!=null) {
                msg.setHeader("In-Reply-To",b.messageId);
                msg.setHeader("References",b.messageId);
            }
        }
View Full Code Here

TOP

Related Classes of hudson.tasks.MailMessageIdAction

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.