From ad6b10fe700e75059b61877671076196ac0d90b7 Mon Sep 17 00:00:00 2001 From: Mo Date: Sun, 17 Nov 2024 11:27:08 -0600 Subject: [PATCH] Subscription emails --- app/mailers/subscription_mailer.rb | 1 - app/views/subscription_mailer/new_subscription.html.erb | 5 +---- .../components/subscription_mailer/NewSubscription.jsx | 9 +++------ 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/app/mailers/subscription_mailer.rb b/app/mailers/subscription_mailer.rb index 213ad24a..5db19795 100644 --- a/app/mailers/subscription_mailer.rb +++ b/app/mailers/subscription_mailer.rb @@ -52,7 +52,6 @@ def weekly_digest(sub_id) def new_subscription(subscription) @author = subscription.author - @subscriber = subscription.subscriber return if @author.email_verified == false diff --git a/app/views/subscription_mailer/new_subscription.html.erb b/app/views/subscription_mailer/new_subscription.html.erb index f61b0ea4..5228f7da 100644 --- a/app/views/subscription_mailer/new_subscription.html.erb +++ b/app/views/subscription_mailer/new_subscription.html.erb @@ -4,8 +4,5 @@ methods: :verified_subscriptions.as_json( only: :id ) - ), - subscriber: @subscriber.as_json( - only: :email - ), + ) }) %> diff --git a/client/app/components/subscription_mailer/NewSubscription.jsx b/client/app/components/subscription_mailer/NewSubscription.jsx index 73b932ae..ccb867c2 100644 --- a/client/app/components/subscription_mailer/NewSubscription.jsx +++ b/client/app/components/subscription_mailer/NewSubscription.jsx @@ -1,11 +1,11 @@ import PropTypes from "prop-types"; import React from "react"; -const NewSubscription = ({ author, subscriber }) => ( +const NewSubscription = ({ author }) => (

- Good news! {subscriber.email} just subscribed to your blog. They'll automatically be notified every - time you publish a new post. + Good news! Someone just subscribed to your blog. They'll automatically be notified every time you + publish a new post.

You now have {author.verified_subscriptions.length} subscriber(s). Keep up the good work!

@@ -19,9 +19,6 @@ NewSubscription.propTypes = { }), ).isRequired, }).isRequired, - subscriber: PropTypes.shape({ - email: PropTypes.string.isRequired, - }).isRequired, }; export default NewSubscription;