Skip to content

Commit

Permalink
Merge pull request #792 from support-project/fix/issue789_mail_url
Browse files Browse the repository at this point in the history
#789 Change the URL of the mail to prioritize the value of the DB fro…
  • Loading branch information
koda-masaru authored Jul 7, 2017
2 parents d124a6e + 6ed705b commit 2e5c215
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import org.support.project.common.util.StringUtils;
import org.support.project.di.DI;
import org.support.project.di.Instance;
import org.support.project.knowledge.config.AppConfig;
import org.support.project.knowledge.config.SystemConfig;
import org.support.project.knowledge.control.Control;
import org.support.project.knowledge.logic.MailLogic;
import org.support.project.knowledge.logic.UserLogicEx;
Expand All @@ -22,9 +24,11 @@
import org.support.project.web.control.service.Post;
import org.support.project.web.dao.ProvisionalRegistrationsDao;
import org.support.project.web.dao.RolesDao;
import org.support.project.web.dao.SystemConfigsDao;
import org.support.project.web.dao.UsersDao;
import org.support.project.web.entity.ProvisionalRegistrationsEntity;
import org.support.project.web.entity.RolesEntity;
import org.support.project.web.entity.SystemConfigsEntity;
import org.support.project.web.entity.UsersEntity;
import org.support.project.web.exception.InvalidParamException;

Expand Down Expand Up @@ -355,8 +359,14 @@ public Boundary accept() {
addMsgSuccess("message.success.accept");

// 承認されたことを通知
SystemConfigsEntity config = SystemConfigsDao.get().selectOnKey(SystemConfig.SYSTEM_URL, AppConfig.get().getSystemName());
String url;
if (config == null) {
url = HttpUtil.getContextUrl(getRequest());
} else {
url = config.getConfigValue();
}
MailLogic mailLogic = MailLogic.get();
String url = HttpUtil.getContextUrl(getRequest());
mailLogic.sendAcceptedAddRequest(entity, url);
} else {
// 他の管理者がすでに承認していました
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ public Boundary save() {
// 仮登録を行う
ProvisionalRegistrationsEntity entity = addProvisionalRegistration();
// 招待のメールを送信
String url = HttpUtil.getContextUrl(getRequest());
SystemConfigsEntity config = SystemConfigsDao.get().selectOnKey(SystemConfig.SYSTEM_URL, AppConfig.get().getSystemName());
String url;
if (config == null) {
url = HttpUtil.getContextUrl(getRequest());
} else {
url = config.getConfigValue();
}
MailLogic mailLogic = MailLogic.get();
mailLogic.sendInvitation(entity, url, HttpUtil.getLocale(getRequest()));
return forward("mail_sended.jsp");
Expand Down

0 comments on commit 2e5c215

Please sign in to comment.