Skip to content

Commit

Permalink
Added two parameters in course enrolment email notification (#129)
Browse files Browse the repository at this point in the history
* Added two parameters in course enrolment email notification
  • Loading branch information
vikrantbipin authored Feb 1, 2024
1 parent c179285 commit 0309f1d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public class CourseBatchNotificationActor extends BaseActor {
.getProperty(JsonKey.SUNBIRD_COURSE_BATCH_NOTIFICATION_SIGNATURE);
private static String baseUrl =
PropertiesCache.getInstance().getProperty(JsonKey.SUNBIRD_WEB_URL);
private static String contentBucket = PropertiesCache.getInstance().getProperty(JsonKey.CONTENT_BUCKET);
private static String staticHostUrl = PropertiesCache.getInstance().getProperty(JsonKey.STATIC_HOST_URL);
private static String profileUpdateUrl = PropertiesCache.getInstance().getProperty(JsonKey.PROFILE_UPDATE_URL);
private static String courseBatchPath =
PropertiesCache.getInstance().getProperty(JsonKey.COURSE_BATCH_PATH);
private UserOrgService userOrgService = UserOrgServiceImpl.getInstance();
Expand Down Expand Up @@ -165,6 +168,16 @@ private Map<String, Object> createEmailRequest(
requestMap.put(JsonKey.BODY, "Notification mail Body");
requestMap.put(JsonKey.ORG_NAME, courseBatchObject.get(JsonKey.ORG_NAME));
requestMap.put(JsonKey.COURSE_LOGO_URL, contentDetails.get(JsonKey.APP_ICON));
if (contentDetails.containsKey(JsonKey.POSTER_IMAGE)) {
String posterImageUrl = (String) contentDetails.get(JsonKey.POSTER_IMAGE);
if (posterImageUrl.contains(staticHostUrl)) {
String[] posterImageUrlArr = posterImageUrl.split("/content/");
posterImageUrl = baseUrl + contentBucket + "/" + posterImageUrlArr[1];
}
requestMap.put(JsonKey.COURSE_POSTER_IMAGE, posterImageUrl);
}
requestMap.put(JsonKey.PROVIDER_NAME, contentDetails.get(JsonKey.SOURCE));
requestMap.put(JsonKey.PROFILE_UPDATE_LINK, baseUrl + profileUpdateUrl);
requestMap.put(JsonKey.START_DATE, courseBatchObject.get(JsonKey.START_DATE));
requestMap.put(JsonKey.END_DATE, courseBatchObject.get(JsonKey.END_DATE));
requestMap.put(JsonKey.COURSE_ID, courseBatchObject.get(JsonKey.COURSE_ID));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ public final class JsonKey {
public static final String CONTACT_DETAILS = "contactDetail";
public static final String CONTAINER = "container";
public static final String CONTENT = "content";
public static final String CONTENT_BUCKET = "content_bucket";
public static final String STATIC_HOST_URL = "static_host_url";
public static final String PROFILE_UPDATE_URL = "profile_update_url";
public static final String CONTENT_CREATOR = "CONTENT_CREATOR";
public static final String CONTENT_ID = "contentId";
public static final String CONTENT_IDS = "contentIds";
Expand Down Expand Up @@ -153,6 +156,10 @@ public final class JsonKey {
public static final String COURSE_IDS = "courseIds";
public static final String COURSE_LIST = "courseList";
public static final String COURSE_LOGO_URL = "courseLogoUrl";
public static final String COURSE_POSTER_IMAGE ="coursePosterImage";
public static final String POSTER_IMAGE ="posterImage";
public static final String PROVIDER_NAME ="providerName";
public static final String PROFILE_UPDATE_LINK = "profileUpdateLink";
public static final String COURSE_MANAGEMENT_DB = "courseManagement_db";
public static final String COURSE_NAME = "courseName";
public static final String COURSE_PROGRESS = "progress";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,6 @@ content_hierarchy_store_key_space_name=dev_hierarchy_store
kafka_cert_pre_processor_topic=dev.issue.program.certificate.request
admin_program_enroll_allowed_primary_category=Program
kafka_user_enrolment_event_topic=dev.user.enrolment.event
content_bucket=/content-store/content
static_host_url=https://static.karmayogiprod.nic.in
profile_update_url=/app/user-profile/details

0 comments on commit 0309f1d

Please sign in to comment.