Commit ee0d2a88 by Nilu

S26465112 # Client - Incoming Issues (raised by Client) #Refinements to the process

adding source option to edit html - in richtext editor.

Adding new veify email link and hiring team name placeholders to messaging engine
parent 19c7b865
......@@ -21,6 +21,9 @@ import performa.orm.ScheduledEmail;
import performa.orm.SentEmail;
import performa.orm.types.PlaceholderOptions;
import oneit.net.LoopbackHTTP;
import performa.orm.Candidate;
import performa.orm.Job;
import static performa.utils.Utils.APPLICANT_VERIFY_LINK;
public class MessagingEngineBatch extends ORMBatch implements InitialisationParticipant
......@@ -41,11 +44,21 @@ public class MessagingEngineBatch extends ORMBatch implements InitialisationPart
LogMgr.log (MESSAGING_ENGINE_BATCH, LogLevel.PROCESSING1, "Starting to create email for scheduled email : " , scheduledEmail);
JobApplication jobApplication = scheduledEmail.getJobApplication();
String link = LoopbackHTTP.getRemoteAccessURL()
Job job = jobApplication.getJob();
Candidate candidate = jobApplication.getCandidate();
String jobLink = LoopbackHTTP.getRemoteAccessURL()
+ "/ApplicantPortal-ApplyJob.htm?cms.rm=SignIn&JobID="
+ jobApplication.getJob().getID()
+ "&UserName=" + jobApplication.getCandidate().getUser().getUserName();
String linkText = "<a href='"+ link +"'>link</a>";
+ "&UserName=" + candidate.getUser().getUserName();
String verifyLink = LoopbackHTTP.getRemoteAccessURL()
+ APPLICANT_VERIFY_LINK
+ "?id=" + job.getID()
+ "&key=" + job.getRandomKey()
+ "&aid=" + candidate.getID()
+ "&pin=" + candidate.getVerificationKey();
// replace tags
String messageContent = StringUtils.replace(scheduledEmail.getMessageContent(),
new String[] {PlaceholderOptions.FIRST_NAME.getPlaceholder(),
......@@ -54,21 +67,25 @@ public class MessagingEngineBatch extends ORMBatch implements InitialisationPart
PlaceholderOptions.LOCATION.getPlaceholder(),
PlaceholderOptions.JOB_TITLE.getPlaceholder(),
PlaceholderOptions.JOB_REFERENCE.getPlaceholder(),
PlaceholderOptions.HIRING_TEAM.getPlaceholder(),
PlaceholderOptions.VERIFY_LINK.getPlaceholder(),
PlaceholderOptions.JOB_LINK.getPlaceholder()},
new String[] {jobApplication.getCandidate().getFirstName(),
jobApplication.getCandidate().getUser().getLastName(),
jobApplication.getCandidate().getUser().getEmail(),
StringUtils.subNulls(jobApplication.getJob().getGoogleAddressText(), ""),
jobApplication.getJob().getJobTitle(),
StringUtils.subNulls(jobApplication.getJob().getReferenceNumber(), ""),
linkText});
new String[] {candidate.getFirstName(),
candidate.getUser().getLastName(),
candidate.getUser().getEmail(),
StringUtils.subNulls(job.getGoogleAddressText(), ""),
job.getJobTitle(),
StringUtils.subNulls(job.getReferenceNumber(), ""),
job.getHiringTeam().getHiringTeamName(),
verifyLink,
jobLink});
LogMgr.log (MESSAGING_ENGINE_BATCH, LogLevel.PROCESSING1, "Replaced tags of message content : " , messageContent);
TextDataSource mesgBodyDataSource = new TextDataSource(messageContent, "text/html", "");
String toEmail = jobApplication.getCandidate().getUser().getEmail();
String toEmail = candidate.getUser().getEmail();
String fromEmail = "Matchd<help@matchd.com>";
String replyToEmail = jobApplication.getJob().getCreatedBy().getUser().getEmail();
String replyToEmail = job.getCreatedBy().getUser().getEmail();
SentEmail sentEmail = SentEmail.createSentEmail(ot);
emailEngine.sendEmail(new String[] {toEmail}, fromEmail, new String[] {replyToEmail}, scheduledEmail.getSubject() , new DataSource[]{mesgBodyDataSource});
......
......@@ -28,14 +28,18 @@ public class PlaceholderOptions extends AbstractEnumerated
public static final PlaceholderOptions LOCATION = new PlaceholderOptions ("LOCATION", "LOCATION", "Location", false);
public static final PlaceholderOptions HIRING_TEAM = new PlaceholderOptions ("HIRING_TEAM", "HIRING_TEAM", "Hiring Team", false);
public static final PlaceholderOptions JOB_TITLE = new PlaceholderOptions ("JOB_TITLE", "JOB_TITLE", "Job Title", false);
public static final PlaceholderOptions JOB_REFERENCE = new PlaceholderOptions ("JOB_REFERENCE", "JOB_REFERENCE", "Job Reference", false);
public static final PlaceholderOptions JOB_LINK = new PlaceholderOptions ("JOB_LINK", "JOB_LINK", "Job Link", false);
public static final PlaceholderOptions VERIFY_LINK = new PlaceholderOptions ("VERIFY_LINK", "VERIFY_LINK", "Verify Link", false);
private static final PlaceholderOptions[] allPlaceholderOptionss =
new PlaceholderOptions[] { FIRST_NAME,SURNAME,EMAIL_ADDRESS,LOCATION,JOB_TITLE,JOB_REFERENCE,JOB_LINK};
new PlaceholderOptions[] { FIRST_NAME,SURNAME,EMAIL_ADDRESS,LOCATION,HIRING_TEAM,JOB_TITLE,JOB_REFERENCE,JOB_LINK,VERIFY_LINK};
private static PlaceholderOptions[] getAllPlaceholderOptionss ()
......@@ -126,9 +130,11 @@ public class PlaceholderOptions extends AbstractEnumerated
SURNAME.Placeholder = "$surname";
EMAIL_ADDRESS.Placeholder = "$emailAddress";
LOCATION.Placeholder = "$location";
HIRING_TEAM.Placeholder = "$hiringTeam";
JOB_TITLE.Placeholder = "$jobTitle";
JOB_REFERENCE.Placeholder = "$jobReference";
JOB_LINK.Placeholder = "$jobLink";
VERIFY_LINK.Placeholder = "$verifyLink";
}
......
......@@ -9,9 +9,11 @@
<VALUE name="SURNAME" value="SURNAME" description="Surname" Placeholder='"$surname"' />
<VALUE name="EMAIL_ADDRESS" value="EMAIL_ADDRESS" description="Email Address" Placeholder='"$emailAddress"' />
<VALUE name="LOCATION" value="LOCATION" description="Location" Placeholder='"$location"' />
<VALUE name="HIRING_TEAM" value="HIRING_TEAM" description="Hiring Team" Placeholder='"$hiringTeam"' />
<VALUE name="JOB_TITLE" value="JOB_TITLE" description="Job Title" Placeholder='"$jobTitle"' />
<VALUE name="JOB_REFERENCE" value="JOB_REFERENCE" description="Job Reference" Placeholder='"$jobReference"' />
<VALUE name="JOB_LINK" value="JOB_LINK" description="Job Link" Placeholder='"$jobLink"' />
<VALUE name="VERIFY_LINK" value="VERIFY_LINK" description="Verify Link" Placeholder='"$verifyLink"' />
</CONSTANT>
</ROOT>
\ No newline at end of file
......@@ -25,10 +25,14 @@
{
candidate = Candidate.searchIdPin(transaction, Long.parseLong(candidateId), pin);
if(candidate != null && candidate.getIsAccountVerified() != Boolean.TRUE)
if(candidate != null)
{
secUser = candidate.getUser();
process.setAttribute("NewCandidate", candidate);
if(candidate.getIsAccountVerified() != Boolean.TRUE)
{
process.setAttribute("NewCandidate", candidate);
}
}
}
......@@ -56,6 +60,13 @@
Article applyJobArticle = WebUtils.getArticleByShortCut(objTran, WebUtils.APPLY_JOB);
String confirmDetailsPage = LoopbackHTTP.getRemoteAccessURL(request)
+ applyJobArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", "VerifyIdentity").toMap(), "/");
String signinPage = LoopbackHTTP.getRemoteAccessURL(request)
+ applyJobArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", "SignIn").toMap(), "/");
if(candidate.getIsAccountVerified())
{
response.sendRedirect(signinPage + "&JobID=" + job.getID().toString());
}
if(candidate.isUnverifiedEmailIngestUser() && candidate.getKnownAsAlias() == null)
{
......
......@@ -4,6 +4,8 @@
<%@ include file="inc/stdimports.jsp" %>
<%@ include file="/editor/stdimports.jsp" %>
<%@ page import="oneit.business.content.editor.gui.*" %>
<%! protected String getName (ServletConfig config) { return "editMessageTemplate_jsp"; } %>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
......@@ -134,7 +136,8 @@
<oneit:ormlabel obj="<%= messageTemplate %>" field="MessageContent"/>
</oneit:layout_label>
<oneit:layout_field width="2">
<tagfile:htmleditor obj="<%= messageTemplate %>" attribName="MessageContent" id="texteditor"/>
<tagfile:htmleditor obj="<%= messageTemplate %>" attribName="MessageContent" id="texteditor"
toolbarSet="<%= EditorGUIOptions.Default %>"/>
</oneit:layout_field>
</oneit:skin>
......
MessageTemplate.ApplicationStatus = Application Status
MessageTemplate.MessageContent = Message Content
MessageTemplate.PlaceholderVariable = Placeholder Variable
MessageTemplate.DelayHrs = Delay
\ No newline at end of file
MessageTemplate.ApplicationStatus = Application Status
MessageTemplate.MessageContent = Message Content
MessageTemplate.PlaceholderVariable = Placeholder Variable
MessageTemplate.DelayHrs = Delay
MessageTemplate.TemplateName = Template Name
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment