Skip to content

Commit

Permalink
Subscription emails
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Nov 17, 2024
1 parent 2871057 commit ad6b10f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion app/mailers/subscription_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 1 addition & 4 deletions app/views/subscription_mailer/new_subscription.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@
methods: :verified_subscriptions.as_json(
only: :id
)
),
subscriber: @subscriber.as_json(
only: :email
),
)
}) %>
9 changes: 3 additions & 6 deletions client/app/components/subscription_mailer/NewSubscription.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import PropTypes from "prop-types";
import React from "react";

const NewSubscription = ({ author, subscriber }) => (
const NewSubscription = ({ author }) => (
<div>
<p>
Good news! {subscriber.email} just subscribed to your blog. They&apos;ll automatically be notified every
time you publish a new post.
Good news! Someone just subscribed to your blog. They&apos;ll automatically be notified every time you
publish a new post.
</p>
<p>You now have {author.verified_subscriptions.length} subscriber(s). Keep up the good work!</p>
</div>
Expand All @@ -19,9 +19,6 @@ NewSubscription.propTypes = {
}),
).isRequired,
}).isRequired,
subscriber: PropTypes.shape({
email: PropTypes.string.isRequired,
}).isRequired,
};

export default NewSubscription;

0 comments on commit ad6b10f

Please sign in to comment.