@VisibleForTesting
protected MimeMessagePreparator prepareSuccessMessage(final String userId, final String template, final String status,
final String server) {
return new MimeMessagePreparator() {
public void prepare(MimeMessage mimeMessage) throws Exception {
CbUser user = userDetailsService.getDetails(userId, UserFilterField.USERID);
MimeMessageHelper message = new MimeMessageHelper(mimeMessage);
message.setFrom(msgFrom);
message.setTo(user.getUsername());
message.setSubject("Cloudbreak - stack installation");
message.setText(getEmailBody(user.getGivenName(), status, server, template), true);
}
};
}