/
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.

EmailMessage message = new EmailMessage(); message.setSubject("Example Subject"); message.setText("Example text body."); // This will send email message to all members of the groups (can be group IDs or names). // If the group was not found within defined namespace, then the warning message will be logged. // The maximum number of groups is 20 due to the limited length of the URL. emailService.sendToGroupMembers(message, "nsCode", "group001", "group002", "group003");

Email Service Models

Email

EmailAddress

EmailAttachments

Related content

NOTE: Trivore ID Documentation has moved to https://trivoreid.com

The content on this site IS OUT OF DATE!

This space has been archived!