Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Need to send a Custom Email based on a Custom Event, without addons

Casper Hjorth Christensen
Contributor
February 18, 2020

Hi Community

I have a need to send a Custom Email, created via the Apache Velocity Engine.

I've added the following files to the folders within: JIRA\atlassian-jira\WEB-INF\classes\templates\email

Subject.vm

HTML.vm

Text.vm

The files do ofc. have the same naming.

I've also gone through the steps of added the custom event, as described here:

https://confluence.atlassian.com/adminjiraserver/adding-a-custom-event-938847495.html

However, I'm unsuccessful in actually sending the email I want.

Any Suggestions?

1 answer

1 accepted

1 vote
Answer accepted
Daniel Ebers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2020

Did you also update the notification scheme and the workflow as well?

I am not sure about the part with "Subject.vm/HTML.vm/Text.vm" as you want to define a new velocity template for a custom event if I understood it correctly.

If this is true you'd need a new velocity template, for example "report.vm" (please feel free to use a name which describes the use case better).

You then need to assign the template to an event in "email-template-id-mappings.xml" file and configure the notification scheme and workflow accordingly, as stated in the beginning.

By default (if not configured otherwise) changes to the "email-template-id-mappings.xml" files Jira needs to be restarted.

That means a thorough test on a non-production environment is highly recommended.

Cheers,
Daniel

Casper Hjorth Christensen
Contributor
February 25, 2020

Hi @Daniel Ebers 

Sorry for not getting back to you earlier, I wasn't notified about your reply.

I found that my error in the setup, was using the ID "99" within the "email-template-id-mappings.xml".

I guess the id's between 1 and 10.000 is reserved for system events and/or filters.

Once I changed my ID to something above the 10.000 mark, it was running perfectly.

 

Oh and yes, you did understand it correctly :)

 

and ofc. I've done it all within our test environments, allowing me to restart the application as often as I needed ;).

Casper Hjorth Christensen
Contributor
March 18, 2020

Hi @Daniel Ebers & Others

 

I've found that trying to send a custom email, setup as previously stated, will not be sent if the project is an Service Desk project, as it would seem the "Customer Notifications" override the normal notification scheme.

Does anyone have a workaround for this?

I still want the "Customer Notifications" to trigger, but i also want to send this custom email that i've build.

 

The "Customer Notifications" allows me to change the overall template, which is not what i want, as i only want the custom layout on our resolved emails.

Suggest an answer

Log in or Sign up to answer