-
Bug
-
Resolution: Unresolved
-
Neutral
-
None
-
2.2.6
-
None
Our partner acdsolutions reported a bug in the commands endpoint. I was able to reproduce it and I think this is a problem related to the commands endpoint.
Steps to reproduce
- Start any Magnolia 6.2.6
- Add the sendMail command under /modules/rest-services/rest-endpoints/commands/enabledCommands
- Try to send a mail via the endpoint
Example request:
http://localhost:8080/.rest/commands/v2/default/sendMail
{ "type": "freemarker", "contentType": "html", "from":"tobias.kerschbaum@magnolia-cms.com", "subject":"subject", "to":"tobias.kerschbaum@magnolia-cms.com", "templateFile":"", "body":"mail body", "attachments":[ { "url":"http://designermag.org/wp-content/uploads/2013/09/Awesome-Animal-Logo-Design.jpg", "name":"test", "fileName":"test", "contentType":"image/jpeg", "disposition":"attachment", "mimeMultipart":"multipart/mixed" } ] }
Expected results
The E-Mail gets send with an attachment.
Actual results
E-Mail is sent but without attachment.
Workaround
Development notes
I debugged the behaviour and I think the problem is as follows:
- The MailCommand line 106 expects a WebContext in order to check any attachments
- The CommandManager has a method with and one without an actual context. If no context is set a SimpleContext is created.
- The CommandEndpoint calls the excuses always without context.
Acceptance criteria