Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ SECRET_KEY=local_development_fake_key

# https://canonical.greenhouse.io/configure/dev_center/credentials
GREENHOUSE_API_KEY=
HARVEST_API_KEY=
HARVEST_V3_CLIENT_ID=
HARVEST_V3_CLIENT_SECRET=
APPLICATION_CRYPTO_SECRET_KEY=super_secret

SERVICE_ACCOUNT_EMAIL=test_email@email.com
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ jobs:
env:
SECRET_KEY: insecure_test_key
APPLICATION_CRYPTO_SECRET_KEY: insecure_test_key
HARVEST_API_KEY: local_development_fake_key
HARVEST_V3_CLIENT_ID: local_development_fake_client_id
HARVEST_V3_CLIENT_SECRET: local_development_fake_client_secret
SERVICE_ACCOUNT_EMAIL: test_email@email.com
SERVICE_ACCOUNT_PRIVATE_KEY: test_private_key
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: PR checks
on: pull_request
env:
SECRET_KEY: insecure_test_key
HARVEST_API_KEY: local_development_fake_key
HARVEST_V3_CLIENT_ID: local_development_fake_client_id
HARVEST_V3_CLIENT_SECRET: local_development_fake_client_secret
APPLICATION_CRYPTO_SECRET_KEY: insecure_test_key
SERVICE_ACCOUNT_EMAIL: test_email@email.com
SERVICE_ACCOUNT_PRIVATE_KEY: test_private_key
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ djlint templates/path/to/file.html --lint --profile=jinja # djlint for html/ji
| Service | Purpose | Key Env Vars |
| ------------- | -------------------------------- | ------------ |
| Discourse API | Blog, takeovers, docs, tutorials | `DISCOURSE_API_KEY`, `DISCOURSE_API_USERNAME`, `MAAS_DISCOURSE_API_KEY`, `MAAS_DISCOURSE_API_USERNAME` |
| Careers | Careers related | `HARVEST_API_KEY`, `APPLICATION_CRYPTO_SECRET_KEY` |
| Careers | Careers related | `HARVEST_V3_CLIENT_ID`, `HARVEST_V3_CLIENT_SECRET`, `APPLICATION_CRYPTO_SECRET_KEY` |
| Greenhouse | Candidate applications | `GREENHOUSE_API_KEY` |
| Google Calendar | Google Calendar service-account auth | `SERVICE_ACCOUNT_EMAIL`, `SERVICE_ACCOUNT_PRIVATE_KEY` |
| Marketo | Marketing / lead gen | `MARKETO_API_URL`, `MARKETO_API_CLIENT`, `MARKETO_API_SECRET` |
Expand All @@ -126,4 +126,4 @@ djlint templates/path/to/file.html --lint --profile=jinja # djlint for html/ji
## Docs

- `README.md` — project overview, setup, development workflow, and common commands
- `AGENTS.md` — instructions and conventions for AI agents/contributors working in the repository
- `AGENTS.md` — instructions and conventions for AI agents/contributors working in the repository
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Environment variables are read from the available shell. For the charm, these ar

## Greenhouse API

To work locally on the `/careers` section of the site, you will need to add a `HARVEST_API_KEY` environment variable to `.env` file. You can find this via the [Greenhouse admin panel](https://canonical.greenhouse.io/configure/dev_center/credentials).
To work locally on the `/careers` section of the site, add `HARVEST_V3_CLIENT_ID` and `HARVEST_V3_CLIENT_SECRET` environment variables to your `.env.local` file.

# Deploy

Expand Down
9 changes: 7 additions & 2 deletions konf/site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ env:
key: greenhouse_api_key
name: canonical-com

- name: HARVEST_API_KEY
- name: HARVEST_V3_CLIENT_ID
secretKeyRef:
key: harvest_api_key
key: harvest_v3_client_id
name: canonical-com

- name: HARVEST_V3_CLIENT_SECRET
secretKeyRef:
key: harvest_v3_client_secret
name: canonical-com

- name: APPLICATION_CRYPTO_SECRET_KEY
Expand Down
4 changes: 2 additions & 2 deletions templates/careers/application/_activate-email.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<p>Thank you for the time you have spent on this application. We would love to collect your thoughts on our process and will shortly be sending you a candidate survey to complete via email. We would very much appreciate your time in helping us understand your feedback.</p>
<p>We would like to take this opportunity to wish you the very best with your next career steps.</p>
<p>Regards,</p>
<p>{{ hiring_lead["name"] }}</p>
<p>{{ hiring_lead["name"] if hiring_lead else "Talent team" }}</p>
<p>For further information on data collection, please refer to our <a href="/legal/data-privacy/recruitment" target="_blank">recruitment privacy notice</a> and <a href="/legal/data-privacy" target="_blank">privacy policy</a>.</p>
</div>
</div>
26 changes: 26 additions & 0 deletions templates/careers/application/_candidate-withdrawal-email.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<!-- djlint:off H005 H016 H030 H031 -->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body style="margin: 0; padding: 0; background-color: #f4f4f4; font-family: Ubuntu, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 300; color: #222;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color: #f4f4f4;">
<tr>
<td align="center" style="padding: 40px 20px;">
<table role="presentation" width="600" cellpadding="0" cellspacing="0" style="background-color: #ffffff; border-radius: 4px;">
<tr>
<td style="padding: 40px;">
<p style="margin: 0 0 16px; font-size: 16px; line-height: 1.6;">Dear {{ candidate_name }},</p>
<p style="margin: 0 0 16px; font-size: 16px; line-height: 1.6;">This email is to acknowledge your withdrawal from consideration for this role. As we are closing your application, your Candidate Dashboard for this application will be deactivated shortly. Thank you for the time you have spent on this application and best wishes for your next career step.</p>
<p style="margin: 0 0 24px; font-size: 16px; line-height: 1.6;">Regards,<br>{{ hiring_lead_name }}</p>
<p style="margin: 0; font-size: 14px; line-height: 1.6; color: #666;">For further information on data collection, please refer to our <a href="https://ubuntu.com/legal/data-privacy/recruitment" style="color: #2b6cb0; text-decoration: none;">recruitment privacy notice</a> and <a href="https://ubuntu.com/legal/data-privacy" style="color: #2b6cb0; text-decoration: none;">privacy policy</a>.</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
11 changes: 11 additions & 0 deletions templates/careers/application/_debug-email-notification.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% macro debug_email_notification(recipient, message, sender=None) %}
<div class="u-fixed-width">
<div class="p-notification--caution">
<div class="p-notification__content">
<h5 class="p-notification__title">[DEBUG] This email wasn't sent because you're in debug mode</h5>
<p>The following email would have been sent to {{ recipient }}{% if sender %} from {{ sender }}{% endif %}:</p>
<p><blockquote>{{ message | safe }}</blockquote></p>
</div>
</div>
</div>
{% endmacro %}
4 changes: 2 additions & 2 deletions templates/careers/application/_withdrawal-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h2 class="u-no-margin--bottom" id="modal-title">Application withdrawal</h2>
<label for="email">Email address</label>
<input required type="email" id="email" name="email" placeholder="example@canonical.com" autocomplete="email"/>
<label for="textarea">Reason you wish to withdraw your application</label>
<select name="withdrawal-reason" id="withdrawal-reason" required>
<select name="withdrawal-reason" id="withdrawal-reason" data-other-reason-value="{{ other_withdrawal_reason_value }}" required>
<option value="" disabled="disabled" selected="">Select</option>
{% for reason_id, reason_message in withdrawal_reasons.items() %}
<option value="{{ reason_id }}">{{ reason_message }}</option>
Expand All @@ -30,4 +30,4 @@ <h2 class="u-no-margin--bottom" id="modal-title">Application withdrawal</h2>
</div>
</div>
</section>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<div>
<p>Dear {{ hiring_lead_name }},</p>
<p>This is an automated email to inform you that {{ applicant_name }} has withdrawn their application for the {{ position }} position.</p>
{% if candidate_email_failed %}
<p>The candidate withdrawal confirmation email could not be sent. Please contact the candidate directly.</p>
{% endif %}
<p>The candidate was in {{ current_stage["name"] }} stage.</p>
<p><a href="{{ application_url }}">Click here to access the candidate's application.</a></p>
<p>Regards,<br>Talent Science Engineering</p>
Expand Down
12 changes: 6 additions & 6 deletions templates/careers/application/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ <h1 class="p-heading--2 u-sv2">
<br />
Application for {{ application["role_name"] }}
</h1>
{% if "stage_progress" in application and application["stage_progress"]["assessment"] and application['source']['id'] == 2 and application['job_post_id'] %}
{% if "stage_progress" in application and application["stage_progress"]["assessment"] and application['source_id'] == 2 and application['job_post_id'] %}
<p class="u-no-margin--bottom">
<a href="/careers/{{ application['job_post_id'] }}"
class="p-link--inverted">Read more about this role&nbsp;&rsaquo;</a>
Expand All @@ -102,15 +102,15 @@ <h1 class="p-heading--2 u-sv2">
</div>
</section>

{% if application["candidate"]["application_ids"]|length >= 2 %}
{% if application["candidate"]["applications"]|length >= 2 %}
<section class="p-strip--light is-shallow">
<div class="u-fixed-width">
<h2 class="p-text--x-small-capitalised u-no-margin--bottom">The status of your other applications:</h2>
<ul class="p-inline-list--middot u-no-margin--bottom">
{% for app in application["candidate"]["applications"] %}
{% if app["status"] != 'rejected' and app["id"] != application["id"] and app["jobs"]|length > 0 and app["jobs"][0]["id"] != second_look_req_id %}
{% if app["status"] != 'rejected' and app["id"] != application["id"] and app["jobs"]|length > 0 and app["jobs"][0]["id"] != second_look_req_id and app["custom_fields"]["canonical_com_application_page"] %}
<li class="p-inline-list__item">
<a href='{{ app["custom_fields"]["canonical_com_application_dashboard"] }}'>{{ app["jobs"][0]["name"] }}</a>
<a href='{{ app["custom_fields"]["canonical_com_application_page"] }}'>{{ app["jobs"][0]["name"] }}</a>
</li>
{% endif %}
{% endfor %}
Expand All @@ -120,7 +120,7 @@ <h2 class="p-text--x-small-capitalised u-no-margin--bottom">The status of your o
{% endif %}
<!-- End thank you for applying section. -->

{% if "stage_progress" in application and application["stage_progress"]["assessment"] or application["stage_progress"]["early_stage"] or application["stage_progress"]["late_stage"] or application["stage_progress"]["offer"] %}
{% if application["hiring_lead"] and ("stage_progress" in application and application["stage_progress"]["assessment"] or application["stage_progress"]["early_stage"] or application["stage_progress"]["late_stage"] or application["stage_progress"]["offer"]) %}
<!-- Hiring lead section. -->
<section class="p-strip">
<div class="row">
Expand Down Expand Up @@ -335,7 +335,7 @@ <h1>Your application has been withdrawn</h1>
withdrawalReason.addEventListener('change', function () {
const withdrawalReasonOther = document.getElementById('withdrawal-reason-other');
const otherInput = document.querySelector('.other-input');
if (withdrawalReason.value === "33") {
if (withdrawalReason.value === withdrawalReason.dataset.otherReasonValue) {
otherInput.style.display = "block";
withdrawalReasonOther.setAttribute("required", "true");
} else {
Expand Down
22 changes: 4 additions & 18 deletions templates/careers/application/withdrawal.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends 'base_index.html' %}
{% from 'careers/application/_debug-email-notification.html' import debug_email_notification %}

{% block content %}

Expand All @@ -9,29 +10,14 @@
end up skipping sending the email in production in a silent way that nobody notices.
-->

<div class="u-fixed-width">
<div class="p-notification--caution">
<div class="p-notification__content">
<h5 class="p-notification__title">[DEBUG] This email wasn't sent because you're in debug mode</h5>
<p>The following email would have been sent to {{ hiring_lead_email }}:</p>
<p><blockquote>{{ email_message | safe }}</blockquote></p>
</div>
</div>
</div>
{{ debug_email_notification(candidate_email, candidate_email_message, candidate_email_from) }}
{{ debug_email_notification(hiring_lead_email, email_message) }}

<!--
Similarly for interview canceled/feedback not needed emails
-->
{% for email in all_sent_emails %}
<div class="u-fixed-width">
<div class="p-notification--caution">
<div class="p-notification__content">
<h5 class="p-notification__title">[DEBUG] This email wasn't sent because you're in debug mode</h5>
<p>The following email would have been sent to {{ email["interviewer"] }}:</p>
<p><blockquote>{{ email["message"] | safe }}</blockquote></p>
</div>
</div>
</div>
{{ debug_email_notification(email["interviewer"], email["message"]) }}
{% endfor %}
{% endif %}
</section>
Expand Down
4 changes: 2 additions & 2 deletions templates/careers/base_job-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="col-6 u-position-relative">
<div class="u-position-sticky u-top-65px">
<h1 class="p-heading--2">{{ job.title }}</h1>
<p class="p-muted-heading">{{ job.location.name }}</p>
<p class="p-muted-heading">{{ job.location }}</p>
</div>
</div>
<div class="col-6">
Expand All @@ -21,7 +21,7 @@ <h1 class="p-heading--2">{{ job.title }}</h1>
<div class="col-6 col-start-large-4 p-strip u-no-padding--top">
<div class="p-strip u-no-padding--top">
<h1 class="p-heading--2">{{ job.title }}</h1>
<p class="p-muted-heading">{{ job.location.name }}</p>
<p class="p-muted-heading">{{ job.location }}</p>
</div>
{% block application_content %}{% endblock %}
</div>
Expand Down
Loading
Loading