What | Where |
---|---|
Source code | https://bitbucket.org/amdatu/amdatu-email |
Issue tracking | https://amdatu.atlassian.net/browse/AMDATUMAIL |
Continuous build | https://amdatu.atlassian.net/builds/browse/AMDATUMAIL |
Amdatu Email provides a service abstraction for sending email. Currently, it provides implementations to send emails through Amazon's Simple Email Service, through a configured SMTP server, as well as a mock implementation for use in test scenario's. |
Deploy the preferred email service bundle; `org.amdatu.email.smtp` or `org.amdatu.email.aws` with your application and inject the EmailService into components as desired. The EmailService then allows you to send emails through the configured email server.
The Amdatu Email bundle depends on the following bundles:
AWSEmailService is configured by providing a configuration for the PID `org.amdatu.email.aws`. Configuration is done by setting the required `aws-key`, `aws-secret` and optional `aws-region` properties.
When no region is specified, the default region will be chosen.
The following example shows how to send an email through the configured AWSEmailService:
instance.send(Message.Builder.create().recipient("success@simulator.amazonses.com").htmlBody("test") .subject("test").from("test@amdatu.com").build()); |
SMTPEmailService is configured by providing a configuration for the PID `org.amdatu.email.smtp`. Configuration is done by setting the required `smtp-host`, `smtp-user`, `smtp-password` and optional `smtp-port`, `smtp-use-ssl`, `smtp-from-name` and `smtp-from-email` properties.
When no port, use-ssl, from-name and from-email properties have been specified, email will be sent through port 25, not using SSL, from user `Amdatu Mail Service` and address `noreply@amdatu.org` by default.
The following example shows how to send an email through the configured SMTPEmailService:
String testBody = "Amdatu Mail Service Test"; String testSubject = "Test Message"; instance.send(Message.Builder.create().recipient("someone@example.com").textBody(testBody).subject(testSubject) .from("test@amdatu.org").build()); |
The Amdatu MongoDB project is licensed underĀ Apache License 2.0.