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; ...@@ -20,6 +20,7 @@ import performa.orm.JobApplication;
import performa.orm.ScheduledEmail; import performa.orm.ScheduledEmail;
import performa.orm.SentEmail; import performa.orm.SentEmail;
import performa.orm.types.PlaceholderOptions; import performa.orm.types.PlaceholderOptions;
import oneit.net.LoopbackHTTP;
public class MessagingEngineBatch extends ORMBatch implements InitialisationParticipant public class MessagingEngineBatch extends ORMBatch implements InitialisationParticipant
...@@ -40,6 +41,11 @@ public class MessagingEngineBatch extends ORMBatch implements InitialisationPart ...@@ -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); LogMgr.log (MESSAGING_ENGINE_BATCH, LogLevel.PROCESSING1, "Starting to create email for scheduled email : " , scheduledEmail);
JobApplication jobApplication = scheduledEmail.getJobApplication(); 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 // replace tags
String messageContent = StringUtils.replace(scheduledEmail.getMessageContent(), String messageContent = StringUtils.replace(scheduledEmail.getMessageContent(),
new String[] {PlaceholderOptions.FIRST_NAME.getPlaceholder(), new String[] {PlaceholderOptions.FIRST_NAME.getPlaceholder(),
...@@ -47,17 +53,19 @@ public class MessagingEngineBatch extends ORMBatch implements InitialisationPart ...@@ -47,17 +53,19 @@ public class MessagingEngineBatch extends ORMBatch implements InitialisationPart
PlaceholderOptions.EMAIL_ADDRESS.getPlaceholder(), PlaceholderOptions.EMAIL_ADDRESS.getPlaceholder(),
PlaceholderOptions.LOCATION.getPlaceholder(), PlaceholderOptions.LOCATION.getPlaceholder(),
PlaceholderOptions.JOB_TITLE.getPlaceholder(), PlaceholderOptions.JOB_TITLE.getPlaceholder(),
PlaceholderOptions.JOB_REFERENCE.getPlaceholder()}, PlaceholderOptions.JOB_REFERENCE.getPlaceholder(),
PlaceholderOptions.JOB_LINK.getPlaceholder()},
new String[] {jobApplication.getCandidate().getFirstName(), new String[] {jobApplication.getCandidate().getFirstName(),
jobApplication.getCandidate().getUser().getLastName(), jobApplication.getCandidate().getUser().getLastName(),
jobApplication.getCandidate().getUser().getEmail(), jobApplication.getCandidate().getUser().getEmail(),
StringUtils.subNulls(jobApplication.getJob().getGoogleAddressText(), ""), StringUtils.subNulls(jobApplication.getJob().getGoogleAddressText(), ""),
jobApplication.getJob().getJobTitle(), 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); 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 toEmail = jobApplication.getCandidate().getUser().getEmail();
String fromEmail = "Matchd<help@matchd.com>"; String fromEmail = "Matchd<help@matchd.com>";
String replyToEmail = jobApplication.getJob().getCreatedBy().getUser().getEmail(); String replyToEmail = jobApplication.getJob().getCreatedBy().getUser().getEmail();
......
...@@ -31,9 +31,11 @@ public class PlaceholderOptions extends AbstractEnumerated ...@@ -31,9 +31,11 @@ public class PlaceholderOptions extends AbstractEnumerated
public static final PlaceholderOptions JOB_TITLE = new PlaceholderOptions ("JOB_TITLE", "JOB_TITLE", "Job Title", 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_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 = 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 () private static PlaceholderOptions[] getAllPlaceholderOptionss ()
...@@ -126,6 +128,7 @@ public class PlaceholderOptions extends AbstractEnumerated ...@@ -126,6 +128,7 @@ public class PlaceholderOptions extends AbstractEnumerated
LOCATION.Placeholder = "$location"; LOCATION.Placeholder = "$location";
JOB_TITLE.Placeholder = "$jobTitle"; JOB_TITLE.Placeholder = "$jobTitle";
JOB_REFERENCE.Placeholder = "$jobReference"; JOB_REFERENCE.Placeholder = "$jobReference";
JOB_LINK.Placeholder = "$jobLink";
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<VALUE name="LOCATION" value="LOCATION" description="Location" Placeholder='"$location"' /> <VALUE name="LOCATION" value="LOCATION" description="Location" Placeholder='"$location"' />
<VALUE name="JOB_TITLE" value="JOB_TITLE" description="Job Title" Placeholder='"$jobTitle"' /> <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_REFERENCE" value="JOB_REFERENCE" description="Job Reference" Placeholder='"$jobReference"' />
<VALUE name="JOB_LINK" value="JOB_LINK" description="Job Link" Placeholder='"$jobLink"' />
</CONSTANT> </CONSTANT>
</ROOT> </ROOT>
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
SecUser secUser = SecUser.getTXUser(transaction); SecUser secUser = SecUser.getTXUser(transaction);
Candidate candidate = secUser.getExtension(Candidate.REFERENCE_Candidate); 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"); Debug.assertion(candidate != null, "Invalid candidate in applicant portal");
......
...@@ -20,6 +20,13 @@ ...@@ -20,6 +20,13 @@
Debug.assertion(job != null, "Job is null in applicant portal"); 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(); String socialLoginNextPage = nextPage + "&JobID=" + job.getID().toString();
%> %>
<script type="text/javascript"> <script type="text/javascript">
...@@ -47,7 +54,10 @@ ...@@ -47,7 +54,10 @@
$(this).change(); $(this).change();
}); });
$('input[name$=Email]').focus(); if($('input[name$=Email]').val() === '')
{
$('input[name$=Email]').focus();
}
}); });
function validate() { function validate() {
......
...@@ -12,16 +12,16 @@ ...@@ -12,16 +12,16 @@
Debug.assertion(job != null && !toRedirect, "Invalid job in applicant portal"); Debug.assertion(job != null && !toRedirect, "Invalid job in applicant portal");
Candidate candidate = (Candidate) process.getAttribute("NewCandidate"); 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); candidate = secUser.getExtension(Candidate.REFERENCE_Candidate);
} }
else
if(secUser == null && candidate != null)
{ {
secUser = candidate.getUser(); secUser = candidate.getUser();
} }
Debug.assertion(candidate != null, "Invalid candidate in applicant portal"); Debug.assertion(candidate != null, "Invalid candidate in applicant portal");
......
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