# Java Docs missing class: notification templates

**URL:** <https://developer.sailpoint.com/discuss/t/java-docs-missing-class-notification-templates/14720>\
**Category:** SHF Discussion and Questions\
**Tags:** email-templates, notifications, sailpoint-identity-security\
**Created:** [July 20, 2023, 8:46am UTC](https://developer.sailpoint.com/discuss/t/java-docs-missing-class-notification-templates/14720 "2023-07-20T08:46:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![angelo\_mekenkamp](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/angelo_mekenkamp/32/3386_2.png) [@angelo\_mekenkamp](https://developer.sailpoint.com/discuss/u/angelo_mekenkamp)\
**Post date:** [July 20, 2023, 8:46am UTC](https://developer.sailpoint.com/discuss/t/java-docs-missing-class-notification-templates/14720/1 "2023-07-20T08:46:23Z")

</div>

Hi!

The IDN java docs can be found here: [Java Docs | SailPoint Developer Community](https://developer.sailpoint.com/idn/docs/rules/java-docs/)

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](https://documentation.sailpoint.com/saas/help/common/emails/available_templates.html)  
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

---

<div class="post-metadata">

**Author:** ![tyler\_mairose](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/tyler_mairose/32/30112_2.png) [@tyler\_mairose](https://developer.sailpoint.com/discuss/u/tyler_mairose)\
**Post date:** [August 1, 2023, 5:25pm UTC](https://developer.sailpoint.com/discuss/t/java-docs-missing-class-notification-templates/14720/3 "2023-08-01T17:25:53Z")

</div>

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.

```java
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();
}

```

```java
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.

---

<div class="post-metadata">

**Author:** ![angelo\_mekenkamp](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/angelo_mekenkamp/32/3386_2.png) [@angelo\_mekenkamp](https://developer.sailpoint.com/discuss/u/angelo_mekenkamp)\
**Post date:** [August 2, 2023, 10:00am UTC](https://developer.sailpoint.com/discuss/t/java-docs-missing-class-notification-templates/14720/4 "2023-08-02T10:00:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [October 7, 2023, 1:30pm UTC](https://developer.sailpoint.com/discuss/t/java-docs-missing-class-notification-templates/14720/6 "2023-10-07T13:30:15Z")

</div>

Closed on October 7, 2023, 1:30pm UTC

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