I'm not sure that HAML is a good choice for email. I would use ERB or Erubis because they allow more rendering, which will work well to populate variable fields.
If you create an HTML attachment in a MIME email address, then HAML would be a good choice for this part of the message, but again, I would probably grab ERB or Erubis to create both the body of the MIME and the HTML part.
If you do not want to use ERB / ββErubis, look at the usual "here-to" line, for example:
body = <<EOT Dear
I think HAML is a great tool, but in my opinion it is not suitable for this situation.
source share