How to send custom templates(robot results) through Groovy script?

Is it possible to send customization report through mail notifications in groovy script. I want to share the report like below.