Automatically set category incoming email address based on slug


(Leo McArdle) #1

This is work I’ve just started doing in a plugin, but requires me to submit a PR to add a DiscourseEvent.trigger to the category model *, so I wondered if the whole feature might have a place upstream.

* I mean I could probably find a way to monkey patch it, but that’s never fun

Proposal for standardised email-in addresses here: Standardised emails-in proposal - Meta - Mozilla Discourse

We want to automatically set this, rather than having to manually update each category’s address.

This would probably take the form of a plugin, which updates everything on startup, hides the edit field, and runs whenever the slug or parent of a category changes.

There would need to be a global setting, to set the domain of the email address, and the plugin would also need to run whenever this changes.

The feature would sit behind a site setting, and in addition to the settings specified in the plugin brief above, a setting to set the subslug divider would also make this more useful for everyone else. We’re going to be going with ., so addresses would be formed like:

<slug>.<subslug>@discourse.mozilla.community

#pr-welcome?


(Leo McArdle) #2

And, as I’ve just realised while developing, it’ll have to run whenever the slug of a parent changes too.