-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Email Notifications #61
Conversation
Parlance.Notifications/Channels/TranslationFreeze/TranslationFreezeNotificationChannel.cs
Outdated
Show resolved
Hide resolved
// Get static properties using Reflection | ||
var autoSubscriptionEventNameProperty = autoSubscriptionType.GetProperty("AutoSubscriptionEventName", BindingFlags.Public | BindingFlags.Static); | ||
var channelNameProperty = channelType.GetProperty("ChannelName", BindingFlags.Public | BindingFlags.Static); | ||
|
||
// Check if the properties exist | ||
if (autoSubscriptionEventNameProperty == null || channelNameProperty == null) | ||
{ | ||
throw new ArgumentException("The required static properties do not exist in the provided types."); | ||
} | ||
|
||
// Get the values of the static properties | ||
var autoSubscriptionEventName = (string)autoSubscriptionEventNameProperty.GetValue(null!)!; | ||
var channelName = (string)channelNameProperty.GetValue(null!)!; | ||
|
||
// Call the original function | ||
return await GetAutoSubscriptionPreference(channelName, autoSubscriptionEventName, userId); |
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 call the generic overload using MakeGenericMethod
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 (and the other files like it) really feel like they want to be scoped services that are automatically resolved and invoked by some "main" hosted service that pulls from the message bus... we might want to see if MessagePipe has some integration with MS.Ext.DI, or maybe switch to a library that does
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 could be rewritten to use symbols instead of syntax
Parlance.Roslyn/SourceGenerators/Notifications/AutoSubscriptionAttributeSourceGenerator.cs
Outdated
Show resolved
Hide resolved
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 source generator (and the other ones) should ideally be using IIncrementalGenerator
instead of ISourceGenerator
. The legacy model is deprecated and can cause performance problems in the IDE
This PR implements a framework for email notifications.
Closes #11
Closes #12
Closes #14