-
-
Notifications
You must be signed in to change notification settings - Fork 359
chore: cancel event email content #1517
chore: cancel event email content #1517
Conversation
👇 Click on the image for a new way to code review
Legend |
View Upcoming Events for ${event.chapter.name}: <a href='${chapterURL}'>${event.chapter.name} chapter</a>.<br /> | ||
----------------------------<br /> | ||
<br /> | ||
- Stop receiving upcoming event notifications for ${event.chapter.name}. you can do it here: <a href="${eventURL}">${eventURL}</a>.<br /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From event page, only further event notifications for that event can be changed. Seems that either wording or url needs to be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated it to this
- Stop receiving event notifications for ${event.name}. You can do it here: <a href="${eventURL}">${eventURL}</a>.<br />
But it maybe redundant, should we delete that line?
Co-authored-by: Krzysztof G. <[email protected]>
Out of curiosity, what's the join and leave function mentioned in comment? |
That sounds like joining and leaving chapter. Joining chapter is implemented as a standalone action and also is implicitly performed when user is RSVPing for an event from not joined chapter. Leaving chapter is not implemented. |
const cancelEventEmail = `The Upcoming Event ${event.name} is canceled.<br /> | ||
<br /> | ||
View Upcoming Events for ${event.chapter.name}: <a href='${chapterURL}'>${event.chapter.name} chapter</a>.<br /> | ||
----------------------------<br /> | ||
<br /> | ||
- Stop receiving event notifications for ${event.name}. You can do it here: <a href="${eventURL}">${eventURL}</a>.<br /> | ||
- More about ${event.chapter.name} or to unfollow this chapter: <a href="${chapterURL}">${chapterURL}</a>.<br /> | ||
<br /> | ||
----------------------------<br /> | ||
You received this email because you Subscribed to ${event.name} Event.<br /> | ||
<br /> | ||
See the options above to change your notifications. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const cancelEventEmail = `The Upcoming Event ${event.name} is canceled.<br /> | |
<br /> | |
View Upcoming Events for ${event.chapter.name}: <a href='${chapterURL}'>${event.chapter.name} chapter</a>.<br /> | |
----------------------------<br /> | |
<br /> | |
- Stop receiving event notifications for ${event.name}. You can do it here: <a href="${eventURL}">${eventURL}</a>.<br /> | |
- More about ${event.chapter.name} or to unfollow this chapter: <a href="${chapterURL}">${chapterURL}</a>.<br /> | |
<br /> | |
----------------------------<br /> | |
You received this email because you Subscribed to ${event.name} Event.<br /> | |
<br /> | |
See the options above to change your notifications. | |
const cancelEventEmail = `The upcoming event ${event.name} has been canceled.<br /> | |
<br /> | |
View upcoming events for ${event.chapter.name}: <a href='${chapterURL}'>${event.chapter.name} chapter</a>.<br /> | |
----------------------------<br /> |
I think this flows better. I deleted the notifications text because it should be possible to DRY it out.
We have two types of emails
- Ones sent in response to a user action
- Ones sent because a user is subscribed
All emails should have the same unsubscribe text
To manage notifications about this event, go to <a href="${eventURL}">${eventURL}</a>.<br />
To manage notifications from this chapter about new events, go to <a href="${chapterURL}">${chapterURL}</a>.<br />
Emails that are sent because the user is subscribed to an event should explain that. Similarly emails that are sent because of a chapter subscription should explain that.
Finally emails that are sent in response to a user action need no explanation.
@Sboonny could you handle this in this PR? I think makes sense to handle them all together, so we can make sure they're consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in 0620983
I have tried to DRY it using unsubscribeOption
, but the resolver didn't use user.id
.
So before I add them, do we need user.id
in cancel events email? although it doesn't make sense to unfollow canceled events, people may want to cancel their chapter membership.
So do we add it? or just link it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems simplest to always provide both of the unsubscribe links. We don't need to customise them for the users current subscription state.
Unfollowing cancelled events should mostly be pointless, but conceivably events could be uncancelled. It's safer to let users unsubscribe and respect their wishes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, random question 😅, the 0620983 should have failed cypress because there were no user.id
, but it succeeded. should we worry about that?
Nvm it checked for 4 tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the tests didn't run, I'm not worried!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for the confusion, the function meant to run without user.id, which is interesting 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Sboonny I hope the suggestions make sense, but give me a shout if they don't.
const unsubScribeOptions = NotificationContextText({ | ||
linkToEvent: eventURL, | ||
linkToChapter: chapterURL, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use getEventUnsubscribeOptions
(and be unsubscribeOptions
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is complicated because this cancel RSVP without userId, so if we are using getEventUnsubscibeOptions
, we will force user to log in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move the text to the resolver with comment of why we are doing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't force users to login when they want to unsubscribe from email notifications. Fortunately, there's no need to. We have access to the userId via event_users
. Since each email is different (different unsubscribe tokens) you can use batchSender
to send them all. There's an example of that in sendEventInvite
.
I have merged this, if there is an issue ping me and if it's breaking the site revert it and ping me to fix it 👍 |
Update README.md
).main
branch of Chapter.Ref #100
Currently, It isn't possible to run cypress locally, and it doesn't work on Gitpod, so I will delay adding test until then.
How it looks
the email content