Commit 2643d663 by Nilu

S24529620 # Client - Incoming Issues (raised by Client) #No way to direct applicant back to app

parent 6bc3ab31
......@@ -20,6 +20,7 @@ import performa.orm.JobApplication;
import performa.orm.ScheduledEmail;
import performa.orm.SentEmail;
import performa.orm.types.PlaceholderOptions;
import oneit.net.LoopbackHTTP;
public class MessagingEngineBatch extends ORMBatch implements InitialisationParticipant
......@@ -40,6 +41,11 @@ 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()
+ "/ApplicantPortal-ApplyJob.htm?cms.rm=SignIn&JobID="
+ jobApplication.getJob().getID()
+ "&UserName=" + jobApplication.getCandidate().getUser().getUserName();
String linkText = "<a href='"+ link +"'>link</a>";
// replace tags
String messageContent = StringUtils.replace(scheduledEmail.getMessageContent(),
new String[] {PlaceholderOptions.FIRST_NAME.getPlaceholder(),
......@@ -47,17 +53,19 @@ public class MessagingEngineBatch extends ORMBatch implements InitialisationPart
PlaceholderOptions.EMAIL_ADDRESS.getPlaceholder(),
PlaceholderOptions.LOCATION.getPlaceholder(),
PlaceholderOptions.JOB_TITLE.getPlaceholder(),
PlaceholderOptions.JOB_REFERENCE.getPlaceholder()},
PlaceholderOptions.JOB_REFERENCE.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(), "")});
StringUtils.subNulls(jobApplication.getJob().getReferenceNumber(), ""),
linkText});
LogMgr.log (MESSAGING_ENGINE_BATCH, LogLevel.PROCESSING1, "Replaced tags of message content : " , messageContent);
TextDataSource mesgBodyDataSource = new TextDataSource(StringUtils.fromHTML(messageContent));
TextDataSource mesgBodyDataSource = new TextDataSource(messageContent, "text/html", "");
String toEmail = jobApplication.getCandidate().getUser().getEmail();
String fromEmail = "Matchd<help@matchd.com>";
String replyToEmail = jobApplication.getJob().getCreatedBy().getUser().getEmail();
......
......@@ -32,8 +32,10 @@ public class PlaceholderOptions extends AbstractEnumerated
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);
private static final PlaceholderOptions[] allPlaceholderOptionss =
new PlaceholderOptions[] { FIRST_NAME,SURNAME,EMAIL_ADDRESS,LOCATION,JOB_TITLE,JOB_REFERENCE};
new PlaceholderOptions[] { FIRST_NAME,SURNAME,EMAIL_ADDRESS,LOCATION,JOB_TITLE,JOB_REFERENCE,JOB_LINK};
private static PlaceholderOptions[] getAllPlaceholderOptionss ()
......@@ -126,6 +128,7 @@ public class PlaceholderOptions extends AbstractEnumerated
LOCATION.Placeholder = "$location";
JOB_TITLE.Placeholder = "$jobTitle";
JOB_REFERENCE.Placeholder = "$jobReference";
JOB_LINK.Placeholder = "$jobLink";
}
......
......@@ -11,6 +11,7 @@
<VALUE name="LOCATION" value="LOCATION" description="Location" Placeholder='"$location"' />
<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"' />
</CONSTANT>
</ROOT>
\ No newline at end of file
......@@ -13,7 +13,7 @@
SecUser secUser = SecUser.getTXUser(transaction);
Candidate candidate = secUser.getExtension(Candidate.REFERENCE_Candidate);
String nextPage = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria") + "&JobID=" + job.getID().toString();
String nextPage = WebUtils.getSamePageInRenderMode(request, "Page") + "&JobID=" + job.getID().toString();
Debug.assertion(candidate != null, "Invalid candidate in applicant portal");
......
......@@ -20,6 +20,13 @@
Debug.assertion(job != null, "Job is null in applicant portal");
if(request.getParameter("UserName")!=null)
{
String userName = (String) request.getParameter("UserName");
job.setEmail(userName);
}
String socialLoginNextPage = nextPage + "&JobID=" + job.getID().toString();
%>
<script type="text/javascript">
......@@ -47,7 +54,10 @@
$(this).change();
});
if($('input[name$=Email]').val() === '')
{
$('input[name$=Email]').focus();
}
});
function validate() {
......
......@@ -12,14 +12,14 @@
Debug.assertion(job != null && !toRedirect, "Invalid job in applicant portal");
Candidate candidate = (Candidate) process.getAttribute("NewCandidate");
SecUser secUser = SecUser.getTXUser(transaction);
SecUser secUser = null;
if(candidate == null && secUser != null)
if(candidate == null)
{
secUser = SecUser.getTXUser(transaction);
candidate = secUser.getExtension(Candidate.REFERENCE_Candidate);
}
if(secUser == null && candidate != null)
else
{
secUser = candidate.getUser();
}
......
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