Open mashirozx opened 2 years ago
Although I haven't had to do this myself, this is probably what I'd try first:
I'd prepend a step where you use ${DRONE_COMMIT_MESSAGE}
to create a custom email template file, replacing any \r\n
instances with <br />
. If you store this file in the project working directory, drone will keep it for the drone-email step. There you can simply refer to the custom template file you just created.
Thanks for your suggestion @mjwwit. But my workflow was build a public Docker image, which I think can't place a template in work directory.
I'm considering adding an auto convert line break
option to drone-email, will such kind of PR be welcomed?
i tried to add proper functionality for this to the template lib, see drone/drone-template-lib#12, but drone is a money operation now.
so i forked it and built my own drone-email. with that version you can do this:
{{ htmlLineBreaks commit.message }}
my fork is the same as drillster's only it's built with the updated template lib.
Hello, do you have any idea on how to convert
\n
or\r
in strings? For example, I'm using variable${DRONE_COMMIT_MESSAGE}
which may output like this: