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
16 changes: 16 additions & 0 deletions app/mailers/session_invitation_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ def attending sessions, member, invitation
end
end

def change_of_details sessions, sponsor, member, invitation, title="Change of details"
@session = sessions
@sponsor = sponsor
@host_address = AddressDecorator.decorate(@session.host.address)
@member = member
@invitation = invitation

load_attachments

subject = "#{title}: #{@session.title} by Codebar - #{l(@session.date_and_time, format: :email_title)}"

mail(mail_args(member, subject)) do |format|
format.html
end
end

def remind_student session, member, invitation
@session = session
@host_address = AddressDecorator.decorate(@session.host.address)
Expand Down
6 changes: 6 additions & 0 deletions app/models/invitation_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@ def self.send_spots_available session
invitation.send_spots_available
end
end

def self.send_change_of_details session, title="Change of details", sponsor
session.invitations.accepted.map do |invitation|
SessionInvitationMailer.change_of_details(session, sponsor, invitation.member, invitation, title).deliver
end
end
end
44 changes: 44 additions & 0 deletions app/views/session_invitation_mailer/change_of_details.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<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'd like to let you know that there's been a last minute change to <%= @session.title %>!</h3>
<p style="font-weight: 300; font-size: 16px; color: #2e2e2e; margin-bottom: 50px;">Below you can find the updated session details:</p>


<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="display: inline-block;">
<div style="min-width: 200px; padding-right: 40px; display: inline-block; vertical-align: top;">

<h3 style="color: #434950; font-size: 17px;font-weight: 600;letter-spacing: 0.02em;">Location</h3>
<h2 style="color: #2D183D; font-weight: 400; "><%= @session.host.name %></h2>
<p style="color: #434950; font-size: 16px; font-weight: 400; padding-bottom: 15px;">
<%= @host_address.to_html %>
</p>
<a href="https://maps.google.com/maps?q=<%= @host_address.postal_code %>" style="color: a369d5 text-decoration: underline"> view map </a>
<div style="width:120px; height:41px; margin-top: 33px;">
<%= link_to full_url_for(@sponsor.website) do %>
<%=image_tag(@session.host.avatar, width: "120px") %>
<% end %>
</div>
</div>

</div>

<% if @sponsor %>
<div style="width:150px; border-left: 1px solid #ececec; padding-left: 50px; display: inline-block;">
<div style="width: 340px; padding-right: 40px; display: inline-block; vertical-align: top;">

<h3 style="color: #434950; font-size: 17px;font-weight: 600;letter-spacing: 0.02em;">Sponsor</h3>
<h2 style="color: #2D183D; font-weight: 400; "><%= @sponsor.name %></h2>
<div style="width:120px; height:41px; margin-top: 33px;">
<%= link_to full_url_for(@sponsor.website) do %>
<%=image_tag(@sponsor.avatar, width: "120px") %></div>
<% end %>
</div>

</div>
<% end %>

<div style="clear:both; width: 100%; height: 10px;"></div>