mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
FEATURE: Add hooks for email poller plugins (#21384)
While we are unable to support OAUTH2 with pop3 (due to upstream dependency ruby/net-pop#16), we are adding the support for mail pollers plugin. Doing so, it would be possible to write a plugin which then uses other ways (microsoft graph sdk for example) to poll emails from a mailbox. The idea is that a plugin would define a class which inherits from Email::Poller and defines a poll_mailbox static method which returns an array of strings. Then the plugin could call register_mail_poller(<class_name>) to have it registered. All the configuration (oauth2 tokens, email, etc) could be managed by sitesettings defined in the plugin.
This commit is contained in:
@ -98,6 +98,13 @@ RSpec.describe DiscoursePluginRegistry do
|
||||
end
|
||||
end
|
||||
|
||||
describe "#mail_pollers" do
|
||||
it "defaults to an empty Set" do
|
||||
registry.reset!
|
||||
expect(registry.mail_pollers).to eq(Set.new)
|
||||
end
|
||||
end
|
||||
|
||||
describe ".register_html_builder" do
|
||||
it "can register and build html" do
|
||||
DiscoursePluginRegistry.register_html_builder(:my_html) { "<b>my html</b>" }
|
||||
|
Reference in New Issue
Block a user