Skip to content

Commit 47c7a90

Browse files
committed
feat: add description to invitation emails
1 parent 408ec71 commit 47c7a90

File tree

6 files changed

+36
-0
lines changed

6 files changed

+36
-0
lines changed

app/views/workshop_invitation_mailer/attending.html.haml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
Workshop
3838
%p #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)}
3939
= link_to 'Update your attendance', full_url_for(invitation_url(@invitation)), class: 'btn'
40+
- if @workshop.description.present?
41+
%p
42+
%strong Description:
43+
= @workshop.description
4044

4145
.content
4246
%table

app/views/workshop_invitation_mailer/attending_reminder.html.haml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
%br
3333
%p #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)}
3434
= link_to 'Update your attendance', full_url_for(invitation_url(@invitation)), class: 'btn'
35+
- if @workshop.description.present?
36+
%p
37+
%strong Description:
38+
= @workshop.description
3539

3640
.content
3741
%table

app/views/workshop_invitation_mailer/invite_coach.html.haml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
%br
3939
%small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)}
4040
= link_to 'View invitation and RSVP', full_url_for(invitation_url(@invitation)), class: 'btn'
41+
- if @workshop.description.present?
42+
%p
43+
%strong Description:
44+
= @workshop.description
4145
%td{ width: '40%', style: 'vertical-align: top;'}
4246
%h4
4347
Venue

app/views/workshop_invitation_mailer/invite_student.html.haml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
%br
3636
%small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)}
3737
= link_to 'View invitation and RSVP', full_url_for(invitation_url(@invitation)), class: 'btn'
38+
- if @workshop.description.present?
39+
%p
40+
%strong Description:
41+
= @workshop.description
3842
%td{ width: '40%', style: 'vertical-align: top;'}
3943
%h4
4044
Venue

spec/mailers/virtual_workshop_invitation_mailer_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@
2929
expect(email.body.encoded).to match('Accept the invitation')
3030
end
3131

32+
it '#attending includes the workshop description' do
33+
description = "This is a test workshop description."
34+
workshop = Fabricate(:workshop, description: description)
35+
invitation = Fabricate(:workshop_invitation, workshop: workshop, member: member)
36+
37+
WorkshopInvitationMailer.attending(workshop, member, invitation).deliver_now
38+
39+
expect(email.body.encoded).to include(description)
40+
end
41+
3242
it '#invite_coach' do
3343
email_subject = "Virtual Workshop Coach Invitation #{humanize_date(workshop.date_and_time, with_time: true)}"
3444

spec/mailers/workshop_invitation_mailer_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,14 @@
6060
expect(email.body.encoded).to match("the workshop on #{humanize_date(workshop.date_and_time, with_time: true)}")
6161
expect(email.body.encoded).to match(workshop.chapter.email)
6262
end
63+
64+
it '#attending includes the workshop description' do
65+
description = "This is a test workshop description."
66+
workshop = Fabricate(:workshop, description: description)
67+
invitation = Fabricate(:workshop_invitation, workshop: workshop, member: member)
68+
69+
WorkshopInvitationMailer.attending(workshop, member, invitation).deliver_now
70+
71+
expect(email.body.encoded).to include(description)
72+
end
6373
end

0 commit comments

Comments
 (0)