dpi / courier

Courier is a Drupal module providing a framework to send messages to entities.
https://drupal.org/project/courier
GNU General Public License v2.0
8 stars 3 forks source link

Convert TemplateCollection to a Config entity instead of Content entity #30

Closed edurenye closed 8 years ago

edurenye commented 8 years ago

Convert TemplateCollection to a Config entity instead of Content entity, then we will be able to export the templates.

mirodietiker commented 8 years ago

The title is possibly too much simplified.

I see that if you need to define mail templates / template collections near to content entities like RNG / events, a template collection also needs to be content entity. Syncing template collections is then only possible through modules like deploy.

IMHO Courier needs to support two completely different use cases that both need to be easy and the architecture should first build the basics on top of the core use case: Provide a rock solid architecture and a UI to create and maintain core trigger mails that should also be established as a default for mail triggers in all contrib modules. :-) We can only provide a great experience for this case if we don't depend on deploy or similar tools.

As a second use case, Courier can then allow additional overrides of template collections from content entities. We just need to decide where we add pluggability.

Berdir commented 8 years ago

I still need to look more into the module, but the most obvious approach seems to be to provide a common interface and have a content and a config entity implementation for it.

mirodietiker commented 8 years ago

From discussions with dpi: It seems, Courier is heavily relying on content entity functionality.

We could start trying to extract an interface to learn where the problems origin. An interface is something that should be extracted anyway.

dpi commented 8 years ago

I'm working on something locally which uses the config system. I hope to show something in the coming days.

dpi commented 8 years ago

I have added a global template collection entity type. This entity is a template collection config entity, where Courier will maintain a local template collection and mirror template values between. Majority of changes are found in: a4e8fe8e

I have converted the Courier System module to use the new global template collections, which is a living example of these configs: a9fc86ed . There are also tests which serve as an example on how to use them.

mirodietiker commented 8 years ago

This sounds perfect.