I'm making some changes to the email notifications sent by Confluence. I've followed the instructions for changing the templates described here:
https://confluence.atlassian.com/display/DOC/Customising+the+eMail+Templates
And added some changes to the language file, to change the text strings.
I haven't been able to find a way to edit the subject, for the mails Confluence send. Is it possible to change that?
Community moderators have prevented the ability to post new answers.
You'll most likely find that for each kind of email that Confluence sends, the subject is configured independently. For example, the new "recommended updates" email that Confluence sends in Confluence 4.2 has its email subject configured by the i18n property key 'daily.summary.email.subject'.
Specifically which emails are you trying to edit? If you can't find the corresponding text in a .properties file in Confluence, I can help you track it down.
Im trying to remove all Confluence content from the mails sent, including the page titles, so im looking to change most of the email titles.
Since i asked, we have found that we need to upgrade confluence, which means it will be a while before i'll look into this again.
I will look in the i18n properties for the subjects, and if i am unable to find specific subjects, i'll create a new question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
They could theoretically live in any .properties file within the confluence jar, or a plugin jar. The daily summary email subject lives in atlassian-plugin.properties in the confluence-daily-summary-email jar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've had some time to look into this again, and i think i may be looking in the wrong translation I18n properties file. I have now upgraded to Confluence 4.2.4, and the properties file i am looking at is
com/atlassian/confluence/core/ConfluenceActionSupport.properties in
WEB-INF/lib/confluence-4.2.4.jar
I have searched the file for the key, you mentioned, but it's not there. Are the email subjects defined in another properties file?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That makes my job a bit more difficult sadly. My task is to change all emails sent from Confluence, so they do not contain any of the information from the page, including the page title.
Do you know where to find the keys for email subjects, for the common page operations? e.g.
Edit page, add page, remove page, add comment, edit comment, remove comment?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'll have a look around and see if I can find them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is not really a flexible solution to the problem, but it will work in the case when you have control of the outgoing mail server, and it is a Postfix server.
The solution is to add a header check to the outgoing mail, and change the subject with a regexp.
Edit main.cf to add smtp header checks
smtp_header_checks = regexp:/etc/postfix/smtp_header_checks
Add a file with the header check regexps, and the the replacement header. There are two checks to catch both simple and utf-8 headers.
/^Subject: \[confluence\] .*/ REPLACE Subject: [confluence] /^Subject: =\?UTF-8\?Q\?\[confluence\].*/ REPLACE Subject: [confluence]
Remember to restart Postfix for the changes to take effect.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry it's taken me so long to get an answer to this. If you want to change the contents of the email subject for notification emails in Confluence, you'll need to edit and re-build your Confluence version from the source code distribution (see Building Confluence from Source Code).
There are a couple of classes you'll need to be aware of:
* com.atlassian.confluence.mail.template.PreRenderedMailNotificationQueueItem - is the class containing the rendered email content to be sent
* com.atlassian.confluence.mail.notification.DefaultNotificationsSender - is the manager class that is responsible for generating mail notification items and putting them on the task queue to be emailed
* All the classes in com.atlassian.confluence.mail.notification.listeners are responsible for triggering notifications to be sent in response to various events within Confluence (eg. Attachment removed, Comment added, page edited, etc.).
Using these classes, you should be able to edit the subject appear as you desire.
Hope this helps :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for clearifying this. I do however want to avoid building confluence from source, so i have not investigated your solution further. I have however found another solution, which works in my special case, by changing the subject in the SMTP server. This is clearly not applicable in all scenarios, but i've posted it as an answer here anyway, since i thought somebody might find it useful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, no worries. That does sound like a better solution :-) Definitely better to avoid customising and building from source if you can.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kristian Andersen @Joe Clark [Atlassian]
Dears,
I also want to change the subject of notification emails sent from Confluence, I am running Confluence 5.9.8 and my SMTP server is Exchange. Is there a good way to change the subject on this version or the latest version 5.10.3? If I must change the Source Code, what is the .jar name and path?
Thanks a lot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In our hosted instance, our notification emails begin with the tag [Confluence] - is it possible to change that to something else?
For example:
Subject: [Confluence] John Adams shared "Bill of Rights, working draft" with you
Changed to:
Subject: [US History] John Adams shared "Bill of Rights, working draft" with you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, you can change it in your Confluence Mail Servers configuration. See our documentation to Configuring a Server for Outgoing Mail for instructions on how the change the Subject Prefix of your mail server config.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm - in my hosted Confluence instance I don't see a 'Mail Servers' item in the 'Configuration' box when I go to Confluence Admin. I've noticed other differences in the options available to admins in my hosted instance versus my installed instance -- would it be something I could achieve perhaps by asking support to configure that item for me (do they perhaps have a super-admin capability in the hosted instances?)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, yes, sorry. In order to prevent abuse of our hosting systems, we restrict customers from accessing all administrative features of our products in Atlassian OnDemand. You can see the full list of restrictions here - https://confluence.atlassian.com/display/AOD/Restricted+Functions+in+Atlassian+OnDemand
Unfortunately we don't allow the prefix to be customised in OnDemand. From the linked page:
Atlassian OnDemand comes with an internal SMTP server configured to send notifications.
The prefix is not configurable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.