Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new campaign bespoke landing page #7137

Closed
wants to merge 8 commits into from

Conversation

ddippolito
Copy link
Contributor

Trello card URL

https://trello.com/c/kqe2MWBV/1253-create-bespoke-landing-pages-for-new-teachers-digital-activity

Changes in this PR:

We're adding a new campaign bespoke landing page. Users will be able to access this temporary landing page through links in QR codes within physical booklets or through emails. The page has a different design from the orginal job search page but we can re-use some of the components.

Screenshots of UI changes:

Screenshot 2024-10-03 at 11 44 38

Copy link

github-actions bot commented Oct 3, 2024

Review app deployed to https://teaching-vacancies-review-pr-7137.test.teacherservices.cloud on AKS

.custom-banner
.govuk-grid-row
.govuk-grid-column-one-third-at-desktop
h1.govuk-heading-l class="govuk-!-margin-bottom-4" = "#{@jobseeker_name}, find your primary teacher job"
Copy link
Contributor

@starswan starswan Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we've only implemented the 'primary teacher' landing page here. Do we not need to parameterise this so we can do secondary teachers (and others) - using education_phase or something similar?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good question, and I've asked it to @EllieNodder myself. This is not technically a landing page but a campaign page.
This is a throwaway campaign page that will run for a certain amount of time, and we can remove it afterwards.

As a broader context, we need to rework the way landing pages are generated, as we need them to be more customisable.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, could we make it so it pulls through either 'primary' or 'secondary', depending on their info in Mailchimp?

Comment on lines 72 to 74
working_patterns << "full_time" if campaign_params.delete(:email_fulltime) == "true"
working_patterns << "part_time" if campaign_params.delete(:email_parttime) == "true"
working_patterns << "job_share" if campaign_params.delete(:email_jobshare) == "true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we not use ActiveModel::Type::Boolean.new.cast(value) here so that we cope with values of "1" (and Yes?) as well as (lowercase) true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks

:email_phase, :email_ECT, :email_fulltime, :email_parttime, :email_jobshare, :email_contact)
.tap do |campaign_params|
campaign_params[:location] = campaign_params.delete(:email_location)
campaign_params[:radius] = campaign_params.delete(:email_radius)
Copy link
Contributor

@starswan starswan Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are supposed to pre-select 15 mile radius if it isn't specified (which it probably won't be?) - or is that going to be done by the email rather than here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the radius is set in the email link. But good observation!

let!(:maths_job1) { create(:vacancy, :past_publish, :no_tv_applications, job_roles: ["teacher"], publish_on: Date.current - 1, job_title: "Maths 1", subjects: %w[Mathematics], organisations: [school], phases: %w[secondary], expires_at: Date.current + 1, geolocation: "POINT(-0.019501 51.504949)") }
let!(:maths_job2) { create(:vacancy, :past_publish, :no_tv_applications, job_roles: ["teacher"], publish_on: Date.current - 2, job_title: "Maths Teacher 2", subjects: %w[Mathematics], organisations: [school], phases: %w[secondary], expires_at: Date.current + 3, geolocation: "POINT(-1.8964 52.4820)") }

it "contains the expected content and vacancies with personalized jobseeker name" do
Copy link
Contributor

@starswan starswan Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering if we should add some simple interaction testing here to make sure that this custom page works as expected, as it seems to have quite a lot of content on it? Also I have just noticed that these jobs are both marked as 'secondary' phase, but the target was 'primary' so not sure why they are showing up? Maybe we should add some jobs outside the radius to show that the radius searches work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll chat with Chloe first and then test the page. I suspect I will still need to tweak something.
After that, I think I'll be better positioned to add more testing.
Consider this a temporary page that will be live only for the campaign's duration.

@ddippolito ddippolito force-pushed the add-bespoke-landing-page-from-campaign branch from decb1a5 to e4aef0f Compare October 17, 2024 15:26
end

def self.[](utm_content_code)
raise "No such campaign page: '#{utm_content_code}'" unless exists?(utm_content_code)
Copy link
Collaborator

@scruti scruti Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we gracefully handle this so users don't get a service error when the param value is wrong?
I would expect a user to get a 404 page or get redirected to the generic vacancies page.

Oh this seems unreachable due to the route constraint bellow.

  get "campaigns/",
      to: "vacancies#campaign_landing_page",
      as: :campaign_landing_page,
      constraints: ->(request) { CampaignPage.exists?(request.params[:utm_content]) }

Forget my original comment then, this is a good enough safeguard!

Comment on lines 88 to 90
working_patterns << "full_time" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_fulltime)) == "true"
working_patterns << "part_time" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_parttime)) == "true"
working_patterns << "job_share" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_jobshare)) == "true"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect these checks would never pass, since the boolean casting will return true instead of "true". So true == "true" doesn't match.

I think we don't even need the comparison:

Suggested change
working_patterns << "full_time" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_fulltime)) == "true"
working_patterns << "part_time" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_parttime)) == "true"
working_patterns << "job_share" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_jobshare)) == "true"
working_patterns << "full_time" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_fulltime))
working_patterns << "part_time" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_parttime))
working_patterns << "job_share" if ActiveModel::Type::Boolean.new.cast(campaign_params.delete(:email_jobshare))

@@ -0,0 +1,134 @@
shared:
whentoapplybespoke+PRIMARY:
banner_image: "campaigns/primary_teacher.jpg"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@ddippolito ddippolito closed this Jan 9, 2025
@ddippolito ddippolito deleted the add-bespoke-landing-page-from-campaign branch January 9, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants