Created
December 20, 2012 06:56
-
-
Save sdorra/4343398 to your computer and use it in GitHub Desktop.
scm-mail-plugin usage example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* @author Sebastian Sdorra | |
*/ | |
public class NotificationService | |
{ | |
private static final Logger logger = LoggerFactory.getLogger( | |
NotificationService.class); | |
private MailService mailService; | |
@Inject | |
public NotificationService(MailService mailService) | |
{ | |
this.mailService = mailService; | |
} | |
public void sendNotification() throws MailSendBatchException { | |
if ( mailService.isConfigured() ){ | |
Email mail = new Email(); | |
mail.setFromAddress("SCM-Administrator", "[email protected]"); | |
mail.addRecipient("Test User", "[email protected]", RecipientType.TO); | |
mail.setSubject("SCM-Manager notification"); | |
mail.setText("Notification from SCM-Manager"); | |
mailService.send(mail); | |
} else { | |
logger.warn("mail service is not configured"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment