pickware / shopware

Shopware Repository
http://www.shopware.com
Other
0 stars 0 forks source link

Support distinct mail templates for every order document type #62

Closed windaishi closed 6 years ago

windaishi commented 6 years ago

This PR depends on https://github.com/shopware/shopware/pull/1464 to be merged first.

1. Why is this change necessary?

Shopware ERP (powered by Pickware) includes a feature that allows users to send order documents as emails from the order documents list. Shopware 5.3 added its own implementation of the same feature. However, in opposition to the ERP implementation, the Shopware implementation does not allow different email templates to be used for different order document types. Since a lot of our users depend on this, Shopware ERP still adds its own implementation of this feature. Because of this, Shopware ERP users are presented with two "send document as email" actions in the order document list, which is irritating and confusing.

2. What does this change do, exactly?

This PR improves Shopware's built-in "send order document as email" feature to support different user-selectable email templates. The appropriate email template is automatically pre-selected for the type of document which is being sent to the user.

image

A new mail template category was added to configure the new mail templates. image

The allocation between mail template and document type is done via the unique field key of the document type model. This is why this PR is dependent on the PR #1464. Mail templates with the name document_[key] are associated with the document type where key = [key].

Also a bigger refactoring of the ExtJS controller for sending the documents was necessary. This is because the logic of how the stores with the needed data are loaded has changed.

5. Which documentation changes (if any) need to be made because of this PR?

Not sure.

6. Checklist

fixpunkt commented 6 years ago

Umh, I think something went wrong here. Did you branch this off of #50?

windaishi commented 6 years ago

Yes i did, because it depends on this branch. I changed the base, should be more clear now. But we have to pay attention, that #50 is merged first.

fixpunkt commented 6 years ago

Mmh ok, this means we need to hurry up and submit #50 to shopware.

fixpunkt commented 6 years ago

The PR this depends on is https://github.com/shopware/shopware/pull/1464.

fixpunkt commented 6 years ago

Opened as https://github.com/shopware/shopware/pull/1490.