Changing mimetype of inbound mail body from Plain/Text to HTML?

cancel
Showing results for 
Search instead for 
Did you mean: 
thomasd_
Member II

Changing mimetype of inbound mail body from Plain/Text to HTML?

Jump to solution

Dear Community,

I have successfully setup latest Version of Alfresco Commuity Edition and enabled Inbound eMail. I'm able to send emails to that folder and email body and attachements are shown. The only issue is that although the email is in HTML the mimetype of the Body is automatically set to Plain/Text. 

Is there a way to change this to HTML/Text? I'll tried to set a rule accordingly. The rule works and creates a copy of the Body with "html" Extension and HTML Mimetype, but the Content of the Body is still shown as Plain. If I Change the mimetype manually to HTML it works fine. There must be a way to automate this?

Thanks in Advance for any helpful answer. 

1 Solution

Accepted Solutions
mehe
Senior Member II

Re: Changing mimetype of inbound mail body from Plain/Text to HTML?

Jump to solution

Hi Thomas,

I think you are already familiar with creating a rule - just use a "execute script" as action for your rule.
You can create/upload the script (Javascriptfile) in the "Data Dictionary/Scripts" Folder (before creating the rule).

In your script there should be a line like

document.properties.content.mimetype="text/html"

document is the global scope object that has triggered your rule (the html Attachment in your case)

Rule actions | Alfresco Documentation 

View solution in original post

3 Replies
mehe
Senior Member II

Re: Changing mimetype of inbound mail body from Plain/Text to HTML?

Jump to solution

Set up a JavaScript rule - you should be able to access and change the mimetype via document.properties.content.mimetype

thomasd_
Member II

Re: Changing mimetype of inbound mail body from Plain/Text to HTML?

Jump to solution

Thnaks Martin for your answer. I'm no professional java developer. Can you perhaps explain a little more detailed how to do this or link on the applicable documentation of the functionality? I'm willing to self teach me the knowledge but I need to get a suitable starting point to learn and to try. 

mehe
Senior Member II

Re: Changing mimetype of inbound mail body from Plain/Text to HTML?

Jump to solution

Hi Thomas,

I think you are already familiar with creating a rule - just use a "execute script" as action for your rule.
You can create/upload the script (Javascriptfile) in the "Data Dictionary/Scripts" Folder (before creating the rule).

In your script there should be a line like

document.properties.content.mimetype="text/html"

document is the global scope object that has triggered your rule (the html Attachment in your case)

Rule actions | Alfresco Documentation