diff --git a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java index 06b981bb..6425bd65 100644 --- a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java +++ b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java @@ -23,37 +23,35 @@ import com.wisemapping.model.Collaboration; import com.wisemapping.model.Mindmap; import com.wisemapping.model.User; import com.wisemapping.rest.model.RestLogItem; -import com.wisemapping.util.VelocityEngineUtils; -import com.wisemapping.util.VelocityEngineWrapper; import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringEscapeUtils; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.context.support.ResourceBundleMessageSource; import javax.servlet.http.HttpServletRequest; import java.io.PrintWriter; import java.io.StringWriter; import java.io.UnsupportedEncodingException; import java.util.HashMap; +import java.util.Locale; import java.util.Map; import java.util.stream.Collectors; final public class NotificationService { final private static Logger logger = Logger.getLogger(Mailer.class); final private static String DEFAULT_WISE_URL = "http://localhost:8080/wisemapping"; - private VelocityEngineWrapper velocityEngineWrapper; + + private ResourceBundleMessageSource messageSource; @Autowired private Mailer mailer; private String baseUrl; - public NotificationService() { - NotifierFilter notificationFilter = new NotifierFilter(); - } - public void newCollaboration(@NotNull Collaboration collaboration, @NotNull Mindmap mindmap, @NotNull User user, @Nullable String message) { try { @@ -106,10 +104,11 @@ final public class NotificationService { } public void newAccountCreated(@NotNull User user) { - final String mailSubject = "Welcome to WiseMapping !"; - final String messageTitle = "Your account has been created successfully"; - final String messageBody = - "
Thank you for your interest in WiseMapping. Click here to start creating and sharing new mind maps. If have any feedback or idea, send us an email to feedback@wisemapping.com .We'd love to hear from you.
"; + final Locale locale = LocaleContextHolder.getLocale(); + + final String mailSubject = messageSource.getMessage("REGISTRATION.EMAIL_SUBJECT", null, locale); + final String messageTitle = messageSource.getMessage("REGISTRATION.EMAIL_TITLE", null, locale); + final String messageBody = messageSource.getMessage("REGISTRATION.EMAIL_BODY", null, locale); sendTemplateMail(user, mailSubject, messageTitle, messageBody); } @@ -160,10 +159,6 @@ final public class NotificationService { // } } - public void setVelocityEngineWrapper(VelocityEngineWrapper engine) { - this.velocityEngineWrapper = engine; - } - public void reportJavascriptException(@Nullable Mindmap mindmap, @Nullable User user, @NotNull RestLogItem errorItem, @NotNull HttpServletRequest request) { final MapThank you for your interest in WiseMapping. Click here to start creating and sharing new mind maps. If have any feedback or idea, send us an email to feedback@wisemapping.com .We'd love to hear from you.
\ No newline at end of file diff --git a/wise-webapp/src/main/resources/messages_es.properties b/wise-webapp/src/main/resources/messages_es.properties index bc69547d..f97a9c81 100644 --- a/wise-webapp/src/main/resources/messages_es.properties +++ b/wise-webapp/src/main/resources/messages_es.properties @@ -52,3 +52,7 @@ UNEXPECTED_ERROR_DETAILS = Error inesperado procesando tu pedido. NO_ENOUGH_PERMISSIONS=El mapa buscado no se encuentra disponible. NO_ENOUGH_PERMISSIONS_DETAILS=No tiene suficiente permisos de acceso para ver este mapa. El mapa no es mas publico o ha sido borrado. +REGISTRATION.EMAIL_SUBJECT=Bienvenido/a a WiseMapping ! +REGISTRATION.EMAIL_TITLE=Tu cuenta ha sido creada exitosamente +REGISTRATION.EMAIL_BODY=Gracias por tu interest en WiseMapping. Hace click aqui para empezar a crear y compatir tus mapas mentales. Ideas y sugerencias, no dudes en contactarnos a feedback@wisemapping.com.
+ diff --git a/wise-webapp/src/main/resources/messages_fr.properties b/wise-webapp/src/main/resources/messages_fr.properties index 9882ffea..f3b8d659 100644 --- a/wise-webapp/src/main/resources/messages_fr.properties +++ b/wise-webapp/src/main/resources/messages_fr.properties @@ -51,3 +51,7 @@ TRY_WELCOME = Cet espace d'édition présente certaines des fonctionnalités de UNEXPECTED_ERROR_DETAILS = Erreur inattendue lors du traitement de la demande. NO_ENOUGH_PERMISSIONS=Cette carte n'est plus accessible. NO_ENOUGH_PERMISSIONS_DETAILS=Vous n'avez pas les droits d'accès suffisants pour voir cette carte. Cette carte est devenue privée, ou a été détruite. + +REGISTRATION.EMAIL_SUBJECT=Bienvenue sur WiseMapping ! +REGISTRATION.EMAIL_TITLE=Votre compte a été créé avec succès +REGISTRATION.EMAIL_BODY=Merci de l'intérêt que vous portez à WiseMapping. Cliquez ici pour commencer à créer et partager de nouvelles cartes mentales. Si vous avez des commentaires ou des idées, envoyez-nous un e-mail à feedback@wisemapping.com. Nous aimerions avoir de vos nouvelles.
\ No newline at end of file diff --git a/wise-webapp/src/main/resources/messages_ru.properties b/wise-webapp/src/main/resources/messages_ru.properties index 0c122588..e9a80baf 100644 --- a/wise-webapp/src/main/resources/messages_ru.properties +++ b/wise-webapp/src/main/resources/messages_ru.properties @@ -56,3 +56,7 @@ CAPTCHA_INVALID_INPUT_RESPONSE="Неверная CAPTCHA, обновите ст MINDMAP_EMPTY_ERROR=Карта не может быть пустой. INVALID_MINDMAP_FORMAT=Недопустимый формат карты. TOO_BIG_MINDMAP= Слишком большая карта - вы достигли лимита в 500 тем. + +REGISTRATION.EMAIL_SUBJECT=Добро пожаловать в WiseMapping! +REGISTRATION.EMAIL_TITLE=Ваша учетная запись успешно создана +REGISTRATION.EMAIL_BODY=Благодарим вас за интерес к WiseMapping. Нажмите здесь, чтобы начать создавать и публиковать новые интеллект-карты. Если у вас есть какие-либо отзывы или идеи, отправьте нам электронное письмо по адресу feedback@wisemapping.com. Мы будем рады услышать от вас.
\ No newline at end of file diff --git a/wise-webapp/src/main/resources/messages_zh.properties b/wise-webapp/src/main/resources/messages_zh.properties index 4c3d54d7..73c64316 100644 --- a/wise-webapp/src/main/resources/messages_zh.properties +++ b/wise-webapp/src/main/resources/messages_zh.properties @@ -55,4 +55,8 @@ CAPTCHA_TIMEOUT_OUT_DUPLICATE=请刷新页面,然后重试。 CAPTCHA_INVALID_INPUT_RESPONSE=输入无效,刷新页面后重试。 MINDMAP_EMPTY_ERROR=思维导图不能为空。 INVALID_MINDMAP_FORMAT=思维导图格式无效。 -TOO_BIG_MINDMAP=你已经达到了一张思维导图中500个主题的限制。 \ No newline at end of file +TOO_BIG_MINDMAP=你已经达到了一张思维导图中500个主题的限制。 + +REGISTRATION.EMAIL_SUBJECT=欢迎来到智慧地图 +REGISTRATION.EMAIL_TITLE=您的帐户已成功创建 +REGISTRATION.EMAIL_BODY=感谢您对 WiseMapping 的关注。点击这里开始创建和分享新的思维导图。如果有任何反馈或想法,请给我们发送电子邮件至 feedback@wisemapping.com。我们很乐意听取您的意见。
\ No newline at end of file diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml index dc4eaba7..591b9bd3 100755 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml @@ -95,7 +95,7 @@