[MGNLFORM-354] Allow configuration of attachment disposition from mail form processor Created: 03/Mar/21  Updated: 26/Aug/22

Status: Open
Project: Magnolia Form Module
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Carlos Cantalapiedra Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: maintenance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File debug.png    
Issue Links:
Problem/Incident
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:
Epic Link: AuthorX Support
Team: AuthorX

 Description   

Currently AbstractEMailFormProcessor uses default configuration of disposition setting when generating list of attachments. This could be easily made configurable together with mime multipart settings to make the output more compatible with target mail system. 

Steps to reproduce

  1. Create page with form component on it. (default form component from magnolia forms module)
  2. Configure your form to send an email after submission.  
  3. As one of the fields in the form pls add formFile component. 
  4. When you are submitting your form, upload to created file field for example jpg image. 
  5. Check Content Disposition for that attachment

Expected results

A chance of switching between DISPOSITION_INLINE and DISPOSITION_ATTACHMENT so the attachment can be view / downloaded

Actual results

When info.magnolia.module.mail.templates.MailAttachment.MailAttachment(URL url, String name) is called, the content disposition is hardcoded to INLINE which causes in some cases (like using Outlook Web App) that the attached image is completely ignored and there is no possibility to view it or even download.

Workaround

N/A

Development notes

info.magnolia.module.mail.templates.MailAttachment class already has the

public static final String DISPOSITION_ATTACHMENT = "attachment"; 

option, but every time is hardcoded to DISPOSITION_INLINE



 Comments   
Comment by Jan Haderka [ 21/Sep/21 ]

Simply adding setters for disposition and mime into the abstract form processor and changing defaults generated by MailUtils to desired setting here should be sufficient. 

Generated at Mon Feb 12 05:39:22 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.