Skip to content

Commit

Permalink
Merge pull request #305 from fnf-org/mfl/fix_emails
Browse files Browse the repository at this point in the history
Mfl/fix emails
  • Loading branch information
beingmattlevy authored Sep 20, 2024
2 parents d7dcd7c + 8bb7553 commit d5c65ff
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.19
1.3.20
4 changes: 2 additions & 2 deletions app/controllers/ticket_requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def payment_reminder
counter = 0
@event.ticket_requests.awaiting_payment.find_each do |ticket_request|
if ticket_request.price.positive?
Rails.logger.debug { "payment_reminder: sending reminder for ticket request: #{ticket_request.inspect}" }
Rails.logger.info { "payment_reminder: sending reminder for ticket request: #{ticket_request.id}" }
TicketRequestMailer.payment_reminder(ticket_request).deliver_later
counter += 1
end
Expand All @@ -272,7 +272,7 @@ def email_ticket_holders
counter = 0

@event.ticket_requests.active.find_each do |ticket_request|
Rails.logger.debug { "email_ticket_holders: sending reminder for ticket request: #{ticket_request.inspect}" }
Rails.logger.info { "email_ticket_holders: sending email to: #{ticket_request.id}, subject: #{subject}" }
TicketRequestMailer.email_ticket_holder(ticket_request, subject, body).deliver_later
counter += 1
end
Expand Down
3 changes: 2 additions & 1 deletion app/mailers/ticket_request_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,11 @@ def request_denied(ticket_request)
def payment_reminder(ticket_request)
# Set the ticket request
self.ticket_request = ticket_request
Rails.logger.info { "payment_reminder: ticket_request: #{ticket_request.id} user: #{ticket_request.user.id}" }

# Generate an authentication token for the user
@auth_token = ticket_request.generate_user_auth_token!
Rails.logger.debug { "payment_reminder: ticket_request: #{ticket_request.inspect} user: #{ticket_request.user.id} auth_token: #{@auth_token}" }
Rails.logger.debug { "payment_reminder: #{ticket_request.inspect} auth_token: #{@auth_token}" }

# Return if the authentication token is blank
if @auth_token.blank?
Expand Down
10 changes: 5 additions & 5 deletions app/views/events/_event_summary.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
%td.px-2
%span.price
= number_to_currency(@event.kid_ticket_price)
- if @event.max_kid_tickets_per_request.present?
%span.muted (Maximum #{@event.max_adult_tickets_per_request} tickets)
- else
%span.muted
(Unlimited tickets)
- if @event.max_kid_tickets_per_request.present?
%span.muted (Maximum #{@event.max_kid_tickets_per_request} tickets)
- else
%span.muted
(Unlimited tickets)

- if @event.active_event_addons?
%span.muted
Expand Down
2 changes: 0 additions & 2 deletions app/views/ticket_request_mailer/email_ticket_holder.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@
= link_to "#{@ticket_request_url}", @ticket_request_url

%p
%p
%i This email was generated by a very friendly #{Faker::Creature::Animal.name} at: #{Time.now}
4 changes: 1 addition & 3 deletions app/views/ticket_request_mailer/payment_reminder.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@
P.S. You can view the status of your request at any time by visiting
= link_to 'this page', @ticket_request_url

%p
%p
%i This email was generated by a very friendly #{Faker::Creature::Animal.name} at: #{Time.now}
%p
38 changes: 27 additions & 11 deletions lib/mailer_previews/ticket_request_mailer_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,37 @@
class TicketRequestMailerPreview < ActionMailer::Preview
def email_ticket_holder
ticket_request = TicketRequest.last
subject = 'Test Subject'
body = "This is my message test
subject = 'FnF Fall Classic - Important Information'
body = "Friends! Family!
<p>
We care deeply about the health, safety, and comfort of attendees at our events
and member of our community. <br>
To help achieve this, we ask all of our members and guests to read,
and abide by our <a href='https://fnf.page.link/coc'>Code Of Conduct</a>
The Classic is a week away! Holy carp!
<p>
We ask that you share this with each of your guests whom you may bring to the event.
VOLUNTEER!
<p>
We are a community driven by volunteerism in the service of the community.
FnF is a community driven by volunteerism. Our events are produced entirely by volunteers, for ourselves!<br>
<b>We can’t throw this event without *your* help!</b> <br>
Please sign up for a couple of shifts. You’ll get to meet awesome new people and have fun doing it!
<p>
As such, we depend upon the energy and vision of members and guests to make our events happen!<br>
Please (re)acquaint yourself with The FnF Way, https://cfaea.net/the-fnf-way/,<br>
and get involved with helping make the event happen!
The volunteer signup sheet: https://signup.app.fnf.org
<p>
If you are looking for a great way to contribute and want to meet a lot of people along the way, <br>
consider taking a shift as a Site Coordinator (SkC).
<p>
WEBSITE:
<p>
We will continue to update The Fall Classic event page with all of the information a raver needs,
so check back before you go!<br>
https://fnf.events/2024-fall-classic
<p>
Friends and Family reminds you to <b>Leave No Trace!</b>
<p>
If you pack it in, you pack it out!<br>
This means that if the packaging, trash, cans, bottles, came with you, it goes home with you!
<p>
“Robot poop” is <b>NOT</b> recyclable. <b>Do not throw any in the trash or recycling!</b>
<p>
<p>
Excited to see all of you there!
"
TicketRequestMailer.with(ticket_request:).email_ticket_holder(ticket_request, subject, body)
end
Expand Down

0 comments on commit d5c65ff

Please sign in to comment.