Java Docs missing class: notification templates

Hi!

The IDN java docs can be found here: Java Docs | SailPoint Developer Community

It does not seem to include the following class:
com.sailpoint.notification.template.util.TemplateUtil
In fact the whole sailpoint.notification package is not visible here.

Could this one be added perhaps? It is being used for the version 2 templates.

The reason we need to view the java docs for this class is the following:

For version 1 templates we can decide who should receive the emails and who should not by replacing the subject of the email template by:
#if( ${user.notifySetting} == “doNotNotify” )no_send#{else}#end
here, notifySetting is a custom identity attribute that we have defined.

It looks like this is not possible for version 2 templates as it has less functionality and does not support retrieving identity attributes (except id, name, email, phone)
Documentation for this can be found here: Available Email Templates - SailPoint Identity Services
To truely convince ourselves that this is not possible, we want to inspect the java docs to see if there are any methods available to help us fetch this identity attribute anyway from within the email template subject.

Kind regards,
Angelo

3 Likes

Hello @angelo_mekenkamp,

The Java Docs you linked are specifically for writing rules.

I can confirm as you stated that (id, name, email, phone) are the only attributes available to v2 templates.

The templateUtil class that exposes the getUser() function uses the Recipient class as the object returned.

public Recipient getUser(String id) {
    UserPreferences userPreferences = _userPreferencesRepository.findByRecipientId(id);
    if (userPreferences != null && userPreferences.getRecipient() != null) {
        return userPreferences.getRecipient();
    }

    return new RecipientBuilder()
                .withId(id)
                .withName(DEFAULT_VALUE)
                .withEmail(DEFAULT_VALUE)
                .withPhone(DEFAULT_VALUE)
                .build();
}
public class Recipient {

	private String _id;

	private String _name;

	private String _phone;

	private String _email;

	public Recipient(RecipientBuilder recipientBuilder) {
		_id = recipientBuilder.getId();
		_email = recipientBuilder.getEmail();
		_name = recipientBuilder.getName();
		_phone = recipientBuilder.getPhone();
	}

	public String getEmail() {
		return _email;
	}

	public String getId() {
		return _id;
	}

	public String getName() {
		return _name;
	}

	public String getPhone() {
		return _phone;
	}

	public RecipientBuilder derive() {
		return new RecipientBuilder()
				.withEmail(_email)
				.withId(_id)
				.withName(_name)
				.withPhone(_phone);
	}

	@Override
	public String toString() {
		return "Recipient {" +
				" id='" + _id + '\'' +
				", name='" + _name + '\'' +
				", phone='" + _phone + '\'' +
				", email='" + _email + '\'' +
				" }";
	}
}

I spoke with our engineering team about this issue. In the short term, the attributes associated with v1 or v2 templates will remain as they are as we transition over from CC. However, we are looking to fix notifications and templates, in general, and are planning to make sure that all attributes are available for all templates in the future.

Thank you for your response @tyler_mairose.
I’ll stay tuned until the version 2 templates have (at least) the same capabilities as the version 1 templates, such that we can also configure who can receive those emails, by replacing the subject with:
#if( ${user.notifySetting} == “doNotNotify” )no_send#{else}The real subject text#end
Until then identities who should never receive emails from IDN might still receive version 2 emails.

4 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.