When it comes to recruitment, company website plays a major role as an application source of candidates. The usual method is to publish a job posting with an email address and ask the candidates to email their resumes.
But with OrangeHRM, we would go beyond the usual way of recruitment and convert the process to a smarter, better approach by integrating your website's careers page with your OrangeHRM recruitment module. Now, whenever a candidate applies from a vacancy published on your website, the application will be directly submitted to the specific vacancy of your OrangeHRM.
Here are the two main methods of getting this done,
- Integrating the OrangeHRM vacancies with the website using RSS feed
- Integrating the OrangeHRM vacancies list with the website using inline frame (Iframe)
Integrating the OrangeHRM vacancies with the website using the RSS feed
In your OrangeHRM application, published vacancies are available as an RSS field. We will be using this for the integration. The feed is available in every OrangeHRM application on the path /recruitmentApply/jobs.rss relative to your OrangeHRM installation.
Examples: https://xyz.orangehrmlive.com/recruitmentApply/jobs.rss
Here, code examples are provided using the PHP language. You may choose a different server-side programming language of your choice, and use the code samples as a guideline.
Before We Begin...
- If your OrangeHRM application is hosted on the OrangeHRM Cloud, no additional actions are required. Please proceed to the Integration Steps.
- If your OrangeHRM application is hosted on your own servers, make sure that your website’s code can read this path in the OrangeHRM application.
- If your OrangeHRM is accessible via a public URL (ex: https://hris.yourcompany.com/), no additional actions are required.
- If your OrangeHRM resides in a private network, you need to make sure that a certain set of URLs are accessible to the public. Please refer to the “What if OrangeHRM is hosted in an internal network, and is not accessible from the internet?” section of this guide.
Integration Steps
1. Read the content from the RSS feed
$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://orangehrm-demo-7x.orangehrmlive.com/recruitmentApply/jobs.rss');
In this example, we have used the Guzzle PHP HTTP client. (It makes it easy to send HTTP requests, encapsulating the underlying complexities. We recommend you to use this package, if you are using PHP for the integration.)
2. Parse the loaded XML
$xml = simplexml_load_string($res->getBody());
The loaded XML will be in the RSS 2.0 format:
There will be <item> tags corresponding to each published vacancy in the list. The tag contains the following format.
IMPORTANT:
- If your OrangeHRM is customized, the <item> tag may contain additional tags which are required for the integration.
- If you need additional information within the <item> tag (eg: Number of openings for the particular vacancy, location/region/country of the vacancy, etc), they can be added. Reach out to the OrangeHRM Implementation Consultant and make a request if these additional fields are needed.
3. Iterate through <item> tags in your web page’s HTML
<table>
<thead>
<tr>
<th>Vacancy</th>
<th>Published Date</th>
<th> </th>
</tr>
</thead>
<tbody>
<?php foreach ($xml->channel->item as $vacancy): ?>
<tr>
<td><?php echo $vacancy->title; ?></td>
<td><?php echo $vacancy->pubDate; ?></td>
<td><a href="<?php echo $vacancy->link; ?>" target="_blank">Apply</a></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
You need to iterate through the array available within the $xml → channel → item, and print the properties of each item within your HTML.
Output of the Above Code:
NOTE: The above HTML example is based on flat PHP. You need to change it according to your website’s language and architecture.
Integrating the OrangeHRM vacancies list with the website using an inline frame (Iframe)
It is possible to add the OrangeHRM vacancies list to your organization's website using Iframes by following these easy and simple steps. In this way, candidates will be able to apply for the vacancies directly. This is a much more efficient process as it will save you from having to manually add candidate information and resumes to the system.
The following steps are best performed by your IT staff or any other 3rd party who may be maintaining your corporate website.
- Obtain the jobs list page of your OrangeHRM system. This will be the address of your OrangeHRM system, followed by /jobs.php.
If you are using OrangeHRM SaaS platform, it will be:
https://yourcompany.orangehrmlive.com/jobs.php
If you have hosted OrangeHRM within your organization, it will be:
https://your-orangehrm-address/jobs.php
- Embed the following within your careers page, using the HTML code below:
<iframe src="https://yourcompany.orangehrmlive.com/jobs.php"></iframe>
You can define the other HTML attributes of the <iframe>tag as you deem necessary.
PRO TIP #1:
If you are using your own theme and have added your own company logo to your OrangeHRM system, you can display this on your jobs page. Instead of simply using the /jobs.php, use /recruitmentApply/jobs.html?logo=1.
Example:
https://yourcompany.orangehrmlive.com/recruitmentApply/jobs.html?logo=1
Once this is done, the code in the website would look something similar to this:
<div class="row">
<iframe id="info" src="https://yourcompany.orangehrmlive.com/jobs.php"
name="info" width="100%" height="400" align="left"
frameborder="0"></iframe>
</div>
PRO TIP #2:
If your OrangeHRM system is hosted on OrangeHRM’s servers, your domain will be yourcompany.orangehrmlive.com. If you are using Content-Security-Policy headers on your corporate website, please ensure that correct frame-ancestors are added there, so that the jobs page can be embedded.
Example: Content-Security-Policy: frame-ancestors 'self' yourcompany.orangehrmlive.com;
PRO TIP #3:
If your OrangeHRM system is hosted on your own server and has implemented Content-Security-Policy or X-Frame-Options: SAMEORIGIN HTTP headers, please ensure that you allow the OrangeHRM URL to be embedded within your corporate website.
Your corporate domain and your OrangeHRM domain may likely differ from each other. Therefore, you need to ensure that the X-Frame-Options header is not sent for the following URLs:
https://orangehrm.yourcompany.com/recruitmentApply/*
https://orangehrm.yourcompany.com/jobs.php
If you are using Content-Security-Policy headers on your corporate website, please ensure that correct frame-ancestors are added there, so that the jobs page can be embedded.
Example: Content-Security-Policy: frame-ancestors 'self' orangehrm.yourcompany.com;
Here is how it will look. This is how we at OrangeHRM have done it on our website:
What if OrangeHRM is hosted on an internal network, and is not accessible from the internet?
In this scenario, you can allow the public to access the job application URLs via the internet with the following steps:
We recommend you create a separate subdomain of your corporate domain for this purpose. (For example, jobs.yourcompany.com). This subdomain should be mapped to the internet-facing host on your internal network. This host needs to have reverse-proxy capabilities.
Let us assume that your OrangeHRM instance is hosted in the local IP address 192.168.1.100.
- Forward traffic for jobs.yourcompany.com to 192.168.1.100 using a reverse proxy. For security purposes, limit the forwarding only for the HTTPS port (443).
- Block access to all other URLs on this subdomain, except for the following:
/recruitmentApply/*
/jobs.php
Based on your network's setup, you can use the internal web server settings (where OrangeHRM is hosted) or any other mechanism such as a firewall or the reverse proxy itself to implement this restriction.
Once this is configured properly, the URLs such as /auth/login will not be accessible via the internet. But others such as /jobs.php and /recruitmentApply/jobs.html?logo=1 will be accessible via https://jobs.yourcompany.com.
Then, you can embed these URLs using an <iframe> to your corporate website.
How to implement search/filter options to the OrangeHRM vacancy list?
Once the vacancies are published on OrangeHRM, organizations can integrate these vacancies onto their website or share these vacancies with job boards where applicants can apply directly from the website to the vacancy published in OrangeHRM.
In such situations, it may be necessary to search or filter vacancies based on certain criteria. OrangeHRM can easily facilitate this requirement by providing 3 options from which you can filter the vacancies in the OrangeHRM vacancy list.
Access to the vacancy directly in OrangeHRM
We can pass the vacancy code into the URL and it will filter the specific vacancy upon clicking on the website vacancy box. Please see the following two URLs which open only the specific vacancy;
Example 01 - https://abcd.orangehrmlive.com/recruitmentApply/3/view
Example 02 - https://abcd.orangehrmlive.com/recruitmentApply/21/view
Here, the highlighted number represents the vacancy code that will take the applicant directly into the vacancy. To get this URL, Go to the job posting section of the vacancy that you have published and click on the Website link highlighted below.
The system opens the selected vacancy in a new window. The user can copy the direct access URL to the vacancy.
Filter the vacancy list based on the country
Large organizations with a presence in multiple countries will publish vacancies required for all applicable countries. If you need to filter the vacancies based on the country in order to incorporate the vacancy list into a regional website or just to have a filter option on the careers page, We can pass the country code into the vacancy URL and it will filter only vacancies for those respective countries. See the below URLs for a set of locations present on the website:
Example 01 - Dubai:
https://abcd.orangehrmlive.com/recruitmentApply/jobs.html?countryCode=AE
Example 02 - Germany:
https://abcd.orangehrmlive.com/recruitmentApply/jobs.html?countryCode=DE
Example 03 - The United States:
https://abcd.orangehrmlive.com/recruitmentApply/jobs.html?countryCode=US
Highlighted here is the Standard Alpha 2 code of the specific country which can be used to filter vacancies based on the country. As per the above example, please also refer to the following table:
Country |
Alpha 2 Code |
Dubai |
AE |
Germany |
DE |
United States |
US |
To know your country code, please visit ISO’s (International Organization for Standardization) Online Browsing Platform [Click Here] and select the country codes and search.
Filter the vacancy list based on the location
Applicants who look for vacancies in organizations with multiple locations may wish to look for vacancies in the location closest to them. Therefore, OrangeHRM can provide vacancies based on the availability of their location. In order to do that, you can pass the Location ID into the vacancy URL and it will filter only the vacancies for that respective location. Please see the following example URL’s which filter the location-specific vacancies:
Example 01 - https://abcd.orangehrmlive.com/recruitmentApply/jobs.html?locationId=4
Example 02 - https://itwp.orangehrmlive.com/recruitmentApply/jobs.html?locationId=3
If the website provides the function to filter based on the location, the above example shows how the redirect URL should be used to filter the criteria.
To get these Location IDs, please contact your implementation consultant or OrangeHRM support team.
Publishing Vacancies in Social Media
Users can share and find suitable candidates for their vacancies through their social media platforms such as LinkedIn, Facebook, or Twitter. In order to accomplish this, once the vacancy is published on Orange HRM, the user can share that link on their preferred social network platform.
Step 1 - Go to the vacancies tab in the OrangeHRM recruitment module.
Step 2 - Click on settings of the required vacancy
Step 3 - Go to the job posting section of the vacancy that you have published and click on the website link highlighted.
The system opens the selected vacancy in a new window. User can copy the URL and share it on social media.
The visualization representation of this vacancy in the social media platforms is displayed as follows:
Configuring the Apache reverse proxy using a VirtualHost configuration.
In this example, we are mapping the jobs page in the,
OrangeHRM Demo Instance (https://orangehrm-demo-6x.orangehrmlive.com/ on 161.47.81.101) with ABCD Company website (https://abcd-rpoxy-test.orangehrmlive.com/jobs.php, where the domain is mapped to 78.136.60.53.)
In the practical scenario, the OrangeHRM Demo instance would be you OrangeHRM instance while the ABCD company website would be your company website that you want to integrate the vacancies into.
Steps:
1. Mapped the abcd-rpoxy-test.orangehrmlive.com domain to 78.136.60.53.
2. Create an index.php file to be placed on the DocumentRoot of abcd-rpoxy-test.orangehrmlive.com, so that it will manually send an HTTP 403 Forbidden response. (Attached: index.php)
3. Added the below VirtualHost to Apache configurations. (Please pay attention to the newly added ProxyPassMatch rules.)
<VirtualHost *:443>
ServerName abcd-rpoxy-test.orangehrmlive.com
DocumentRoot /var/www/html/OHRMStandalone/TEST/abcd-rpoxy-test ErrorLog logs/abcd-rpoxy-test-error_log CustomLog logs/abcd-rpoxy-test-access_log common
SSLEngine on
SSLProtocol all
SSLCertificateFile /path/to/certs/orangehrmlive.com.crt
SSLCertificateKeyFile /path/to/certs/private.key
SSLCertificateChainFile /path/to/certs/ca-cert.crt
SetEnv HTTPS on
SSLProxyEngine on
ProxyPass /jobs.php https://orangehrm-demo-6x.orangehrmlive.com/jobs.php timeout=3600 keepalive=On disablereuse=On
ProxyPass /index.php/recruitmentApply/jobs.html https://orangehrm-demo-6x.orangehrmlive.com/index.php/recruitmentApply/jobs.html timeout=3600 keepalive=On disablereuse=On
ProxyPassMatch ^/webres(.*) https://orangehrm-demo-6x.orangehrmlive.com/webres$1 timeout=3600 keepalive=On disablereuse=On
ProxyPassMatch ^/recruitmentApply/(.*) https://orangehrm-demo-6x.orangehrmlive.com/recruitmentApply/$1 timeout=3600 keepalive=On disablereuse=On
ProxyPassMatch ^/client/build/(.*) https://orangehrm-demo-6x.orangehrmlive.com/client/build/$1 timeout=3600 keepalive=On disablereuse=On
ProxyPassMatch ^/js/tinymce/(.*) https://orangehrm-demo-6x.orangehrmlive.com/js/tinymce/$1 timeout=3600 keepalive=On disablereuse=On
ProxyPassMatch ^/recruitmentApply/(.*) https://orangehrm-demo-6x.orangehrmlive.com/recruitmentApply/$1 timeout=3600 keepalive=On disablereuse=On
ProxyPassMatch ^/client/build/(.*) https://orangehrm-demo-6x.orangehrmlive.com/client/build/$1 timeout=3600 keepalive=On disablereuse=On
ProxyPassMatch ^/js/tinymce/(.*) https://orangehrm-demo-6x.orangehrmlive.com/js/tinymce/$1 timeout=3600 keepalive=On disablereuse=On
</VirtualHost>
4. Tested configurations and reloaded the apache service.
Testing:
1. Go to https://abcd-rpoxy-test.orangehrmlive.com/. It should give a HTTP 403 Forbidden message.
2. Go to https://abcd-rpoxy-test.orangehrmlive.com/jobs.php. The list of published job vacancies should be displayed.
3. Select one vacancy, fill in the form and apply. Attaching a simple .txt file as a resume would suffice. You should get a message stating that the application is successfully submitted.
4. Go to https://orangehrm-demo-6x.orangehrmlive.com/, and log in as "admin". Go to Recruitment -> Candidates. The application you just submitted should be available right on the top of the list.)
(Since this is our internal demo, the credentials will be pre-populated. Also, note that the database of this instance will be refreshed once every 4 hours. Your applications will not be visible, if you check later.)
You can replicate the same steps and testing procedures adjusting to your private network. Please feel free to reach out to us, if you need further assistance.