ExternalServiceKeyChain externalKeys = new ExternalServiceKeyChain(getServletContext());
cachedPublisherName = externalKeys.getPublisherName();
cachedFromAddress = externalKeys.getFromAddress();
}
LivingStoryEntity livingStory = pm.getObjectById(LivingStoryEntity.class,
eventContentItem.getLivingStoryId());
String baseLspUrl = getBaseServerUrl() + "/lsps/" + livingStory.getUrl();
String eventSummary = eventContentItem.getEventSummary();
String eventDetails = eventContentItem.getContent();
if (GlobalUtil.isContentEmpty(eventSummary)
&& !GlobalUtil.isContentEmpty(eventDetails)) {
eventSummary = SnippetUtil.createSnippet(JavaNodeAdapter.fromHtml(eventDetails),
EMAIL_ALERT_SNIPPET_LENGTH);
}
ImmutableMap<String, String> placeholderMap = new ImmutableMap.Builder<String, String>()
.put("storyTitle", livingStory.getTitle())
.put("updateTitle", eventContentItem.getEventUpdate())
.put("publisherName", cachedPublisherName)
.put("snippet", StringUtil.stripForExternalSites(eventSummary))
.put("linkUrl", baseLspUrl + "#OVERVIEW:false,false,false,false,n,n,n:"
+ eventContentItem.getId())