Skip to content

feat: add unsubscribe#152

Open
spaenleh wants to merge 6 commits intomainfrom
116-unsubscribe-email
Open

feat: add unsubscribe#152
spaenleh wants to merge 6 commits intomainfrom
116-unsubscribe-email

Conversation

@spaenleh
Copy link
Member

@spaenleh spaenleh commented Feb 3, 2026

close #116

@spaenleh spaenleh self-assigned this Feb 3, 2026
@spaenleh spaenleh added the feature New feature or request label Feb 3, 2026
@spaenleh spaenleh force-pushed the 116-unsubscribe-email branch 4 times, most recently from 03fbd23 to ea24e09 Compare February 6, 2026 07:50
@spaenleh spaenleh requested a review from pyphilia February 9, 2026 08:35
@spaenleh spaenleh force-pushed the 116-unsubscribe-email branch from 8e0d5f2 to c819789 Compare February 16, 2026 07:33
Copy link
Contributor

@pyphilia pyphilia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

|> Repo.insert()
end

def member_marketing_emails(%Account{} = account, enable_emails) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the name of this function, should it include a mention for "update"?

end)

{filtered_audience,
%{total: length(audience), excluded: length(audience) - length(filtered_audience)}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider to have a variable for length(audience)?

{:ok, account} = Accounts.member_marketing_emails(account, false)

conn
|> put_flash(:info, "Unsubscribed from marketing emails")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translate?

{:ok, account} = Accounts.member_marketing_emails(account, true)

conn
|> put_flash(:info, "Subscribed to marketing emails")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translate?

attr :name, :string, required: true
attr :message, :string, required: true, doc: "The primary message of the email"
attr :pixel, :string, doc: "The tracking pixel"
attr :account, :string, doc: "The account (for emails targetting graasp members)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
attr :account, :string, doc: "The account (for emails targetting graasp members)"
attr :account, :string, doc: "The account (for emails targeting graasp members)"

<div class="flex flex-col gap-1">
<span>{@notification.audience} {@recipients.included}</span>
<span>
{gettext("Excluded: %{count} (incompatible language, or not subscribed)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{gettext("Excluded: %{count} (incompatible language, or not subscribed)",
{gettext("Excluded: %{count} (incompatible language, or unsubscribed from marketing emails)",

<h1>{@page_title}</h1>
<%= if is_nil(@account.marketing_emails_subscribed_at) do %>
<p>
<.icon name="hero-check-circle" class="size-6 text-success mr-2" />You have successfully unsubscribed from marketing emails.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we avoid the mention of marketing? Like using news or updates instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement unsubscribe feature that would be available in the footer of the newsletter emails

2 participants