diff --git a/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/EmailTemplateManager.java b/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/EmailTemplateManager.java index 0c467a00..ff6596b4 100644 --- a/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/EmailTemplateManager.java +++ b/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/EmailTemplateManager.java @@ -129,6 +129,8 @@ default List getEmailTemplateType(String templateDisplayName, Str } /** + * @deprecated Use {@link #getEmailTemplateType(String, String, String, boolean)} instead. + *

* Get all email templates of a specific template type for an application, from tenant registry. * * @param templateDisplayName Email template type displace name. @@ -137,6 +139,7 @@ default List getEmailTemplateType(String templateDisplayName, Str * @return A list of email templates that matches to the provided template type. * @throws I18nEmailMgtException if an error occurred. */ + @Deprecated default List getEmailTemplateType( String templateDisplayName, String tenantDomain, String applicationUuid) throws I18nEmailMgtException { @@ -247,6 +250,8 @@ void deleteEmailTemplate(String templateTypeName, String applicationUuid) throws I18nEmailMgtException; /** + * @deprecated Use {@link #getEmailTemplate(String, String, String, String, boolean)} instead. + *

* Get an email template from tenant registry with application UUID. * * @param templateType Email template type. @@ -256,6 +261,7 @@ void deleteEmailTemplate(String templateTypeName, * @return Email template of the application with fallback to organization template. * @throws I18nEmailMgtException If an error occurred while getting the email template. */ + @Deprecated EmailTemplate getEmailTemplate(String templateType, String locale, String tenantDomain, diff --git a/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/EmailTemplateManagerImpl.java b/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/EmailTemplateManagerImpl.java index c3227562..7a002d7a 100644 --- a/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/EmailTemplateManagerImpl.java +++ b/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/EmailTemplateManagerImpl.java @@ -192,6 +192,8 @@ public List getAllEmailTemplates(String tenantDomain) throws I18n public EmailTemplate getEmailTemplate(String templateDisplayName, String locale, String tenantDomain) throws I18nEmailMgtException { + /* When resolve param is not specified, the default behavior results in resolved templates, + since resolved templates are always required when sending emails at runtime. */ return getEmailTemplate(templateDisplayName, locale, tenantDomain, null, true); } @@ -199,14 +201,19 @@ public EmailTemplate getEmailTemplate(String templateDisplayName, String locale, public List getEmailTemplateType(String templateDisplayName, String tenantDomain) throws I18nEmailMgtException { + /* When resolve param is not specified, the default behavior results in resolved templates, + since resolved templates are always required when sending emails at runtime. */ return getEmailTemplateType(templateDisplayName, tenantDomain, null, true); } + @Deprecated @Override public List getEmailTemplateType(String templateDisplayName, String tenantDomain, String applicationUuid) throws I18nEmailMgtException { - return getEmailTemplateType(templateDisplayName, tenantDomain, applicationUuid, false); + /* When resolve param is not specified, the default behavior results in resolved templates, + since resolved templates are always required when sending emails at runtime. */ + return getEmailTemplateType(templateDisplayName, tenantDomain, applicationUuid, true); } @Override @@ -260,15 +267,20 @@ public NotificationTemplate getNotificationTemplate(String notificationChannel, String tenantDomain) throws NotificationTemplateManagerException { + /* When resolve param is not specified, the default behavior results in resolved templates, + since resolved templates are always required when sending emails at runtime. */ return getNotificationTemplate(notificationChannel, templateType, locale, tenantDomain, null, true); } + @Deprecated @Override public NotificationTemplate getNotificationTemplate(String notificationChannel, String templateType, String locale, String tenantDomain, String applicationUuid) throws NotificationTemplateManagerException { - return getNotificationTemplate(notificationChannel, templateType, locale, tenantDomain, applicationUuid, false); + /* When resolve param is not specified, the default behavior results in resolved templates, + since resolved templates are always required when sending emails at runtime. */ + return getNotificationTemplate(notificationChannel, templateType, locale, tenantDomain, applicationUuid, true); } @Override @@ -584,11 +596,14 @@ public void deleteEmailTemplate(String templateTypeName, String localeCode, Stri } } + @Deprecated @Override public EmailTemplate getEmailTemplate(String templateType, String locale, String tenantDomain, String applicationUuid) throws I18nEmailMgtException { - return getEmailTemplate(templateType, locale, tenantDomain, applicationUuid, false); + /* When resolve param is not specified, the default behavior results in resolved templates, + since resolved templates are always required when sending emails at runtime. */ + return getEmailTemplate(templateType, locale, tenantDomain, applicationUuid, true); } @Override diff --git a/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/NotificationTemplateManagerImpl.java b/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/NotificationTemplateManagerImpl.java index ffaccb78..7652f29c 100644 --- a/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/NotificationTemplateManagerImpl.java +++ b/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/NotificationTemplateManagerImpl.java @@ -177,10 +177,13 @@ public boolean isNotificationTemplateTypeExists(String notificationChannel, Stri /** * {@inheritDoc} */ + @Deprecated @Override public List getAllNotificationTemplates(String notificationChannel, String tenantDomain) throws NotificationTemplateManagerException { + /* When resolve param is not specified, the default behavior results in unresolved templates, + maintaining backward compatibility with the previous behavior of the method. */ return getAllNotificationTemplates(notificationChannel, tenantDomain, false); } @@ -218,12 +221,15 @@ public List getNotificationTemplatesOfType(String notifica /** * {@inheritDoc} */ + @Deprecated @Override public List getNotificationTemplatesOfType(String notificationChannel, String templateDisplayName, String tenantDomain, String applicationUuid) throws NotificationTemplateManagerException { + /* When resolve param is not specified, the default behavior results in unresolved templates, + maintaining backward compatibility with the previous behavior of the method. */ return getNotificationTemplatesOfType(notificationChannel, templateDisplayName, tenantDomain, applicationUuid, false); } @@ -261,11 +267,14 @@ public NotificationTemplate getNotificationTemplate(String notificationChannel, /** * {@inheritDoc} */ + @Deprecated @Override public NotificationTemplate getNotificationTemplate(String notificationChannel, String templateType, String locale, String tenantDomain, String applicationUuid) throws NotificationTemplateManagerException { + // When resolve param is not specified, the default behavior results in unresolved template, + // maintaining backward compatibility with the previous behavior of the method. return getNotificationTemplate(notificationChannel, templateType, locale, tenantDomain, applicationUuid, false); }