If you made it to this website you’re probably aware of our add-on mailto.wiki – Email for Confluence that allows you to create pages and blog posts from emails in Confluence Cloud, Server and Data Center. It is available on the Atlassian Marketplace. What you might n0t know, is that you can now also append incoming emails to existing pages instead of creating new pages. In combination with the templates settings you can configure mailto.wiki to only add attachments to an existing page. Which is a feature some of our customers have asked for.
For this tutorial let’s assume that we have a page called “My Pdf” in a space called “Documents”. We want to append all pdfs in emails to this page.
Create the Space Rule
After you have installed and configured mailto.wiki (Cloud, Server/Data Center) you will have to create a new Space Rule to append all incoming emails to the page “My Pdf”. Go to the configuration page of mailto.wiki and click on the Space Rules tab. Then click on Add Rule and create a new rule.
- Set the Condition to “From contains @” that way the rule will apply to all emails.
- In Actions select the Space “Documents”.
- Finally set the parent page and choose “Append to page”.
- Save your space rule.
After you created your space rule save your settings by clicking on the Save Settings button:
Now all incoming emails including attachments will be added to the My Pdf page.
Adjusting the templates
As you can see incoming emails including attachments are now added to our page “My Pdf” however for this tutorial we assume that we only want to add the attachments not the actually contents to the page. We can achieve that by adjusting the templates in the Templates tab on the configuration page.
Under Pages/Blog Posts set all templates to “<span></span>”. Don’t forget to click on Save Settings after editing the templates.
That’s it now all incoming emails will add attachments to the page without modifying the contents.
With the settings shown in this tutorial it’s easy to configure mailto.wiki to add attachments to existing pages. You can play around with the templates if you want to customize the text that is appended to pages.
You might also want to take a look at the settings in the Attachments tab. Here you can further customize how attachments are handled by mailto.wiki. For example you could limit attachments to PDFs.