Skip to content

Commit

Permalink
#191 Adapted new email template proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
unaibrrgn committed Mar 16, 2023
1 parent 69fdd79 commit 1e6eeed
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ application.language.label.en=English (en)
#application.language.label.it=Italiano (it)
application.language.defaultLocale=en

application.default.name = Re3gistry2

# ECAS base URL (authetication method)
application.ecas.baseurl = https://webgate.ec.europa.eu

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ role.permissions.registerOwner=ManageUser,ManageGroup,MapUserToGroup
role.permissions.controlBody=ApproveProposal
role.permissions.submittingOrganization=ManageItemProposal,SubmitProposal

application.default.name

#### End Roles and permissions section #########################################

### Mail ###
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ discard.contentclass.confirm=Are you sure you want to remove the content class?

profile.label.title = User profile

application.default.name = Re3gistry2

#installation fileds

installation.main.title=Re3gistry installation wizard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public class BaseConstants {
public static final String KEY_PROPERTY_LOGIN_TYPE = "application.login.type";
public static final String KEY_PROPERTY_LOGIN_TYPE_SHIRO = "SHIRO";
public static final String KEY_PROPERTY_LOGIN_TYPE_ECAS = "ECAS";

public static final String KEY_PROPERTY_APP_DEFAULT_NAME = "application.default.name";

public static final String KEY_PROPERTY_INTERFACE_TYPE = "application.selected.interface";
public static final String KEY_PROPERTY_INTERFACE_NEUTRAL_TYPE = "neutral";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ public static void sendActionMail(List<RegItemproposed> regItemproposeds, RegAct

String itemstatus =regAction.getRegStatus().getLocalid();

String subject = "";
String body = systemLocalization.getString(BaseConstants.KEY_EMAIL_BODY_ITEMACTION_BASE);
//Subject: Updates on [Registry name variable] change proposals +systemLocalization.getString(BaseConstants.KEY_PROPERTY_APP_DEFAULT_NAME)+
String subject = "Updates on "+ systemLocalization.getString(BaseConstants.KEY_PROPERTY_APP_DEFAULT_NAME) +" change proposals";
String body = "<br> Dear " + regAction.getRegUser().getName()+", <br><br> Changes have ocurred on the following item(s): <br><br>";

if(itemstatus.equals(BaseConstants.KEY_STATUS_LOCALID_DRAFT) && originClass.equals(BaseConstants.KEY_FIELD_MANDATORY_SUBMITTINGORGANIZATIONS)){
itemstatus = systemLocalization.getString(BaseConstants.KEY_EMAIL_BODY_ITEMACTION_REJECTED);
Expand All @@ -210,14 +211,12 @@ public static void sendActionMail(List<RegItemproposed> regItemproposeds, RegAct
}

if(originClass.equalsIgnoreCase(BaseConstants.KEY_FIELD_MANDATORY_CONTROLBODY)){
subject = BaseConstants.KEY_EMAIL_SUBJECT_ITEMACTION_CONTROLBODY;
for(int i=0;i<regItemproposeds.size(); i++){
body +="The item "+ regItemproposeds.get(i).getLocalid() + " proposed by " + itemUserNames.get(i) + " was "+ itemstatus + ". The action was made by " + actionMakerNames.get(i);
body += "A change proposal for item " + regItemproposeds.get(i).getLocalid() + " has been proposed by Submitting Organisation member " + actionMakerNames.get(i)+". <br><br>";
}
}else if(originClass.equalsIgnoreCase(BaseConstants.KEY_FIELD_MANDATORY_SUBMITTINGORGANIZATIONS)){
subject = systemLocalization.getString(BaseConstants.KEY_EMAIL_SUBJECT_ITEMACTION_SUBMITTINGORG);
for(int i=0;i<regItemproposeds.size(); i++){
body +="The item "+ regItemproposeds.get(i).getLocalid() + " proposed by " + itemUserNames.get(i) + " was "+ itemstatus + ". The action was made by " + actionMakerNames.get(i);
body += "The item "+ regItemproposeds.get(i).getLocalid() + " proposed by " + itemUserNames.get(i) + " has been " + itemstatus + " by the control body member "+ actionMakerNames.get(i)+". <br><br>";
}
}

Expand Down

0 comments on commit 1e6eeed

Please sign in to comment.