Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added rejection comment in email template #49

Open
wants to merge 4 commits into
base: cbrelease-4.8.4
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ public class NotificationServiceImpl {

private static final String TO_VALUE_TAG = "#toValue";

private static final String COMMENT_TAG = "#comment";

private static final String TO_VALUE_CONST = "toValue";

private static final String MAIL_SUBJECT = "Your request is #state";
private static final String MDO_MAIL_SUBJECT = "Request for approval";

private static final String MAIL_BODY = "Your request to update #fieldKey to #toValue is #state.";
private static final String MAIL_BODY = "Your request to update #fieldKey to #toValue is #state, due to #comment";

/**
* Send notification to the user based on state of application
Expand Down Expand Up @@ -110,7 +112,7 @@ public void sendNotification(WfRequest wfRequest) {
if (updatedFieldValue.isPresent()) {
HashMap<String, Object> toValue = (HashMap<String, Object>) updatedFieldValue.get().get(TO_VALUE_CONST);
params.put("body", MAIL_BODY.replace(STATE_NAME_TAG, wfStatusEntity.getCurrentStatus()).replace(FIELD_KEY_TAG, toValue.entrySet().iterator().next().getKey())
.replace(TO_VALUE_TAG, (String)toValue.entrySet().iterator().next().getValue()));
.replace(COMMENT_TAG, (String) toValue.entrySet().iterator().next().getValue()).replace(TO_VALUE_TAG, (String) toValue.entrySet().iterator().next().getValue()));
}
params.put("orgImageUrl", null);
template.setParams(params);
Expand Down Expand Up @@ -162,7 +164,7 @@ public void sendEmailNotification(WfRequest wfRequest) {
if (updatedFieldValue.isPresent()) {
HashMap<String, Object> toValue = (HashMap<String, Object>) updatedFieldValue.get().get(TO_VALUE_CONST);
params.put("body", MAIL_BODY.replace(STATE_NAME_TAG, wfStatusEntity.getCurrentStatus()).replace(FIELD_KEY_TAG, toValue.entrySet().iterator().next().getKey())
.replace(TO_VALUE_TAG, (String) toValue.entrySet().iterator().next().getValue()));
.replace(COMMENT_TAG, (String) toValue.entrySet().iterator().next().getValue()).replace(TO_VALUE_TAG, (String) toValue.entrySet().iterator().next().getValue()));
}
params.put("orgImageUrl", null);
template.setParams(params);
Expand Down