public <T extends SubscriptionAwareEntity> void sendTopicMovedMail(
JCUser recipient, Topic topic, String curUser, Class<T> subsсriptionTargetClass) {
String urlSuffix = getTopicUrlSuffix(topic);
String url = this.getDeploymentRootUrl() + urlSuffix;
Locale locale = recipient.getLanguage().getLocale();
Map<String, Object> model = new HashMap<>();
model.put(NAME, recipient.getUsername());
model.put(CUR_USER, curUser);
model.put(LINK, url);
model.put(LINK_UNSUBSCRIBE, this.getDeploymentRootUrl()
+ topic.getUnsubscribeLinkForSubscribersOf(subsсriptionTargetClass));
model.put(LINK_LABEL, getDeploymentRootUrlWithoutPort() + urlSuffix);
model.put(RECIPIENT_LOCALE, locale);
try {
this.sendEmail(recipient.getEmail(), messageSource.getMessage("moveTopic.subject",
new Object[]{}, locale), model, "moveTopic.vm");
} catch (MailingFailedException e) {
LOGGER.error("Failed to sent activation mail for user: " + recipient.getUsername());
}
}