%--
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%
String tabs3 = ParamUtil.getString(request, "tabs3", "invite-email");
String[] tabs3Values = StringUtil.split(tabs3, StringPool.DASH);
NotificationTemplateType notificationTemplateType = NotificationTemplateType.parse(tabs3Values[0]);
NotificationType notificationType = NotificationType.parse(tabs3Values[1]);
CalendarNotificationTemplate calendarNotificationTemplate = CalendarNotificationTemplateLocalServiceUtil.fetchCalendarNotificationTemplate(calendar.getCalendarId(), notificationType, notificationTemplateType);
long calendarNotificationTemplateId = BeanPropertiesUtil.getLong(calendarNotificationTemplate, "calendarNotificationTemplateId");
User defaultSenderUser = NotificationUtil.getDefaultSenderUser(calendar);
String fromAddress = NotificationUtil.getTemplatePropertyValue(calendarNotificationTemplate, CalendarNotificationTemplateConstants.PROPERTY_FROM_ADDRESS, defaultSenderUser.getEmailAddress());
String fromName = NotificationUtil.getTemplatePropertyValue(calendarNotificationTemplate, CalendarNotificationTemplateConstants.PROPERTY_FROM_NAME, defaultSenderUser.getFullName());
String defaultTemplateSubject = NotificationUtil.getDefaultTemplate(notificationType, notificationTemplateType, NotificationField.SUBJECT);
String notificationTemplateSubject = BeanPropertiesUtil.getString(calendarNotificationTemplate, "subject", defaultTemplateSubject);
String defaultTemplateBody = NotificationUtil.getDefaultTemplate(notificationType, notificationTemplateType, NotificationField.BODY);
String notificationTemplateBody = BeanPropertiesUtil.getString(calendarNotificationTemplate, "body", defaultTemplateBody);
%>
-
[$EVENT_LOCATION$]
-
-
[$EVENT_START_DATE$]
-
-
[$EVENT_TITLE$]
-
-
[$EVENT_URL$]
-
-
[$FROM_ADDRESS$]
-
<%= HtmlUtil.escape(fromAddress) %>
-
[$FROM_NAME$]
-
<%= HtmlUtil.escape(fromName) %>
-
[$PORTAL_URL$]
-
<%= company.getVirtualHostname() %>
-
[$TO_ADDRESS$]
-
-
[$TO_NAME$]
-
function initEditor() {
return '<%= UnicodeFormatter.toString(notificationTemplateBody) %>';
}
function updateCalendarNotificationTemplate() {
var notificationTemplateContentBody = document.getElementById('body');
if (notificationTemplateContentBody) {
notificationTemplateContentBody.value = window.editor.getHTML();
}
submitForm(document.fm);
}