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
12 changes: 7 additions & 5 deletions app/views/shared_mailers/_social.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
%td

%h5 Connect with us:
-# background-color is inlined on each link because email clients only
-# reliably render inline styles; see issue #2634
%p
%a{ href: "https://slack.codebar.io/", class: 'soc-btn sl'} Join us on Slack
%a{ href: "https://www.linkedin.com/company/codebarcommunity", class: "soc-btn li" } Follow us on LinkedIn
%a{ href: "https://www.facebook.com/codebarHQ", class: 'soc-btn fb'} Follow us on Facebook
%a{ href: "https://bsky.app/profile/codebar.bsky.social", class: "soc-btn bs" } Follow us on Bluesky
%a{ href: "https://www.youtube.com/channel/UCEYz232agE47GHUq8wneBCA", class: "soc-btn yt" } Follow us on YouTube
%a{ href: "https://slack.codebar.io/", class: 'soc-btn sl', style: 'background-color: #2EB67D;' } Join us on Slack
%a{ href: "https://www.linkedin.com/company/codebarcommunity", class: "soc-btn li", style: 'background-color: #0077B5;' } Follow us on LinkedIn
%a{ href: "https://www.facebook.com/codebarHQ", class: 'soc-btn fb', style: 'background-color: #3B5998;' } Follow us on Facebook
%a{ href: "https://bsky.app/profile/codebar.bsky.social", class: "soc-btn bs", style: 'background-color: #1daced;' } Follow us on Bluesky
%a{ href: "https://www.youtube.com/channel/UCEYz232agE47GHUq8wneBCA", class: "soc-btn yt", style: 'background-color: #FF0000;' } Follow us on YouTube



Expand Down
11 changes: 11 additions & 0 deletions spec/mailers/workshop_invitation_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@
expect(email.body.encoded).to match(workshop.chapter.email)
end

it '#invite_student renders social links with inline background colours' do
# asserts on the template output before premailer runs, so the colours
# don't depend on email.css being resolved (see issue #2634)
mail = described_class.invite_student(workshop, member, invitation)

html = mail.body.decoded
['#2EB67D', '#0077B5', '#3B5998', '#1daced', '#FF0000'].each do |colour|
expect(html).to include("background-color: #{colour}")
end
end

it '#attending renders workshop description as HTML, not escaped' do
description = '<strong>Important notice:</strong> Please bring a laptop.'
workshop = Fabricate(:workshop, description: description)
Expand Down