Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is it possible to change the subject of notification emails sent from Confluence.

Kristian Andersen June 11, 2012

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?

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 13, 2012

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.

Kristian Andersen June 17, 2012

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.

Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 26, 2012

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.

Kristian Andersen June 26, 2012

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?

Kristian Andersen June 26, 2012

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?

Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 28, 2012

I'll have a look around and see if I can find them.

1 vote
Kristian Andersen July 31, 2012

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.

1 vote
Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 16, 2012

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 :-)

Kristian Andersen July 31, 2012

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.

Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 8, 2012

Ah, no worries. That does sound like a better solution :-) Definitely better to avoid customising and building from source if you can.

Lei Jiang August 17, 2016

@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.

0 votes
DigiCert Dev Ops July 9, 2012

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

Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 16, 2012

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.

DigiCert Dev Ops July 16, 2012

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?)

Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 17, 2012

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.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events