/
Email Service (java)
NOTE: Trivore ID Documentation has moved to https://trivoreid.com
The content on this site IS OUT OF DATE!
This space has been archived!
Please go ahead to the new site!
Email Service (java)
Wrapper for the '/email' APIs.
List of all options:
Send custom email
Send email to a user
Send email to the group members
Initialize service
TrivoreID sdk = TrivoreID.mgmtApiClient();
EmailServiceImpl emailService = new EmailServiceImpl(sdk.emailService());
Simple email message
EmailMessage message = new EmailMessage();
message.setTo(Arrays.asList(new Email("example1@example.com"),
new Email("example2@example.com"),
new Email("example3@example.com")));
message.setSubject("Example Subject");
message.setText("Example text body.");
emailService.send(message);
Send email to a user by user ID
EmailMessage message = new EmailMessage();
message.setSubject("Example Subject");
message.setText("Example text body.");
emailService.sendToUser(message, "userID");
Send email to all group members
Sending email to all primary (first) email addresses of users that belong to the defined groups.