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
Binary file added app/assets/images/shutl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions app/mailers/invitation_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def invite sessions, member, invitation

load_attachments

subject = "HTML & CSS by Codebar - Wednesday Oct 30th, 18:30"
subject = "#{@session.title} by Codebar - #{l(@session.date_and_time, format: :email_title)}"

mail(mail_args(member, subject)) do |format|
format.html
Expand All @@ -18,7 +18,7 @@ def invite sessions, member, invitation
private

def load_attachments
%w{logo.png unboxed.jpg}.each do |image|
%w{logo.png shutl.png}.each do |image|
attachments.inline[image] = File.read("#{Rails.root.to_s}/app/assets/images/#{image}")
end
end
Expand Down
24 changes: 13 additions & 11 deletions app/views/invitation_mailer/invite.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<h2 style="font-weight: 400; font-size: 24px; border-bottom:1px solid #ececec; padding-bottom: 15px; margin-bottom:35px">Hi <%= @member.name %></h2>

<h3 style="font-weight: 600; font-size: 17px; letter-spacing: 0.02em; color: #111111">We would like to invite you to the next <b>codebar</b> session</h3>
<p style="font-weight: 300; font-size: 16px; color: #2e2e2e; margin-bottom: 50px;"> In our sessions, you will be able to go through HTML/CSS, Javascript and Ruby tutorials with help and guidance from our <b>superstar coaches</b>. You will also get the opportunity to meet other people interested in coding and pair with them.<br></p>
<p style="font-weight: 300; font-size: 16px; color: #2e2e2e; margin-bottom: 50px;"> In our sessions, you will be able to go through HTML/CSS, Javascript and Ruby tutorials and also get guidance on your personal projects with help from our <b>superstar coaches</b>. You will also get the opportunity to meet other people interested in coding and pair with them.<br></p>

<div style="display:inline-block">
<div style="width:340px; padding-right: 50px; display: inline-block;">
<h2 style="color: #2d183d; font-size: 27px; font-weight: 500;letter-spacing: 0.03em; margin-bottom: 0;">HTML & CSS by Codebar</h2>
<small>In this session we will be introducing CSS</small>
<p style="font-size: 16px; font-weight: 300; margin-top: 7px;">on <b style="color: #555555;font-size: 16px; font-weight: 600; margin-top: 0;">Wed, 30 October at 18:30</b></p>
<div style="width:340px; padding-right: 40px; display: inline-block;">
<h2 style="color: #2d183d; font-size: 27px; font-weight: 500;letter-spacing: 0.03em; margin-bottom: 0;"><%= @session.title %> by Codebar</h2>
<small><%= @session.description %></small>
<p style="font-size: 16px; font-weight: 300; margin-top: 7px;">on <b style="color: #555555;font-size: 16px; font-weight: 600; margin-top: 0;"><%= l(@session.date_and_time, format: :email)%></b></p>
<div style="background-color: #F7F7F7; width: 90%; border-radius: 6px; box-shadow: 1px 1px 0 rgba(250, 250, 250, 0.5) inset, -1px -1px 2px rgba(250, 250, 250, 0.1) inset; font-size: 18px; padding: 5px 14px; text-align: center; margin: 31px 0 25px; border: 1px solid #dddddd;">
<p> <%= link_to "I want to attend", full_url_for(accept_invitation_url(@invitation)), style: "text-decoration:none; color: #663095; font-size: 25px; font-weight: 600; letter-spacing: 0.02em; margin: 10px; text-decoration: none; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);"%></p>
</div>
Expand All @@ -17,12 +17,14 @@

<div style="width:150px; border-left: 1px solid #ececec; padding-left: 50px; display: inline-block;">
<h3 style="color: #434950; font-size: 17px;font-weight: 600;letter-spacing: 0.02em;">Location</h3>
<h2 style="color: #2D183D; font-weight: 400; ">Unboxed Consulting</h2>
<p style="color: #434950;font-size: 17px;font-weight: 400;">
17 Blossom Street<br>
London, E1 6PL<br></p>
<a href="http://goo.gl/maps/AuKrs" style="color: #a369d5; text-decoration: underline" >view map</a>
<div style="width:120px; height:56px; margin-top: 33px;"><%=image_tag(attachments["unboxed.jpg"].url, width: "120px", height: "56px") %></div>
<h2 style="color: #2D183D; font-weight: 400; ">Shutl</h2>
<p style="color: #434950;font-size: 16px; font-weight: 400;">
The Courtyard building<br/>
11 Curtain Road, 2nd Floor<br/>
London, EC2A 3LT<br/>
</p>
<a href="http://goo.gl/maps/nIfo6" style="color: #a369d5; text-decoration: underline" >view map</a>
<div style="width:120px; height:56px; margin-top: 33px;"><%=image_tag(attachments["shutl.png"].url, width: "120px") %></div>
</div>

</div>
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ en:
time:
formats:
default: "%a, %d %b %Y %H:%M "
email: "%a, %d %B at %H:%M "
email_title: "%A, %d %b at %H:%M"
short: "%d/%m/%Y %H:%M "
date: "%d %B %Y"

Expand Down
1 change: 1 addition & 0 deletions spec/fabricators/session_fabricator.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Fabricator(:sessions) do
seats 1
date_and_time { DateTime.new }
end
4 changes: 2 additions & 2 deletions spec/mailers/invitation_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

it "#invite" do
member = Fabricate(:member)
sessions = Fabricate(:sessions)
sessions = Fabricate(:sessions, title: "HTML & CSS", date_and_time: DateTime.new(2013,10,30,18,30))
invitation_token = "token"

email_subject = "HTML & CSS by Codebar - Wednesday Oct 30th, 18:30"
email_subject = "HTML & CSS by Codebar - Wednesday, 30 Oct at 18:30"
InvitationMailer.invite(sessions, member, invitation_token).deliver

expect(email.subject).to eq(email_subject)
Expand Down