Currently i am using Jenkins for CI/CD purpose and Email Extension Plugin for sending mail. I need to include commit details and changes in email and send it to default recipient after build completed successfully.
Simply specify '${SCRIPT,template="groovy-html.template"}'
as the body of the email.
emailext (
mimeType: 'text/html',
subject: '$BUILD_STATUS: $PROJECT_NAME - Build # $BUILD_NUMBER',
to: '$DEFAULT_RECIPIENTS',
body: '${SCRIPT,template="groovy-html.template"}'
)
This is one of the default email templates that also displays the changelog with color coded build status.