Skip to content

Commit

Permalink
Add black friday email
Browse files Browse the repository at this point in the history
  • Loading branch information
miharekar committed Nov 23, 2024
1 parent 8af7acc commit 372cd3f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/mailers/user_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ def yearly_brew

mail to: @user.email, subject: "Bean There, Brewed That: Your Year in Coffee"
end

def black_friday
@user = params[:user]
mail to: @user.email, subject: "A Different Kind of Black Friday on Visualizer"
end
end
38 changes: 38 additions & 0 deletions app/views/user_mailer/black_friday.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<%= content_for :title, "Your Visualizer Premium Subscription Has Been Extended" %>
<%= content_for :preheader, "One month added to your Premium subscription, no strings attached." %>
<tr>
<td class="sm-px-0" style="width: 100%; padding-left: 24px; padding-right: 24px; text-align: left">
<table style="width: 100%;" cellpadding="0" cellspacing="0">
<tr>
<td>
<table style="width: 100%;" cellpadding="0" cellspacing="0">
<tr>
<td style="border-radius: 4px; background-color: #fff; padding: 24px; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05)">
<h1 style="margin: 0 0 36px; font-size: 36px; line-height: 36px; color: #000">
Your Visualizer Subscription Just Got Extended
</h1>
<p style="margin: 0 0 24px; font-size: 16px; color: #000">
In case you missed my <a class="hover-no-underline" target="_blank" style="color: #db3e27; text-decoration-line: underline" href="https://visualizer.coffee/updates/black-friday">recent update</a>, I've extended your Premium subscription by one month, completely free. No strings attached.
</p>
<p style="margin: 0 0 24px; font-size: 16px; color: #000">
You can check your updated subscription details by visiting your <a class="hover-no-underline" target="_blank" style="color: #db3e27; text-decoration-line: underline" href="https://visualizer.coffee/premium/manage">subscription management page</a> or by clicking your profile picture and selecting "Manage Subscription".
While you're there, it might be a good time to verify that your card information is up to date.
</p>
<p style="margin: 0 0 24px; font-size: 16px; color: #000">
I've also made two simple decisions about Visualizer's future: no more discounts ever, and no price increases for the foreseeable future.
For details, read the <a class="hover-no-underline" target="_blank" style="color: #db3e27; text-decoration-line: underline" href="https://visualizer.coffee/updates/black-friday">recent update</a>.
</p>
<p style="margin: 0 0 24px; font-size: 16px; color: #000">
Thank you for being a Premium subscriber and supporting Visualizer's development. Enjoy your extra month! ☕️
</p>
<p style="margin: 0 0 24px; font-size: 16px; color: #000">
Miha
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
5 changes: 5 additions & 0 deletions test/mailers/previews/user_mailer_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ def yearly_brew
user = User.order("RANDOM()").first
UserMailer.with(user:).yearly_brew
end

def black_friday
user = User.order("RANDOM()").first
UserMailer.with(user:).black_friday
end
end

0 comments on commit 372cd3f

Please sign in to comment.