I see the problem is different than the direction we are debugging.
When i write the variable to a file i see new lines but when the variable assigned to email body it does not interpolate the new line instead prints ‘\n’
I see the problem is different than the direction we are debugging.
When i write the variable to a file i see new lines but when the variable assigned to email body it does not interpolate the new line instead prints '\n'
body: "{{ mailbody }}"
from: me@myshop.com
to: you@yourmail.com
Can you please suggest?
You already put two errors in your task which prevent it from running correctly.
So in that light, i'm wondering if your actual task does, in fact,
contain more differences than what you've posted here.
Also, "prints '\n'" indicates that you're echoing? and not mailing?
That was a typo the problem remains writing to a file is all good with newlines while writing to email body does not translate “\n” as new line !! Could this be a bug ?
That was a typo; however, the problem remains!! Writing to a file is all good with newline while writing to email body does not translate “\n” as new line !! Could this be a bug? Kindly suggest.
Just tried it out and it works fine here.
Can you show again the complete playbook? Including the task where the
body is generated?
That must be the issue I think.