I want to embed a view in an email sent by the Rules module using the standard "Send mail" action. I have the Mime Mail and Mail System modules installed, and I can send HTML email when it is included in the body of a rule.
Based on this question, I tried the Insert View module, but that only allows views to be inserted into node content, not rules (which are entities, but Insert View does not support generic entities). I tried adding
[view:view_name=display_name] to the message body of my rule, but the view did not appear. To make sure it wasn't working, I added another rule with the "show a message" action and tried to embed the view there, which also didn't work. However, I can place the exact same code inside a node body and the view DOES appear, so it appears that Insert View does not work with Rules.
Entity Views Attachment does support generic entities, but this "attaches" the view, whereas what I am trying to do is embed the view in a rule's email message body like this:
MY TEXT - HEADER
MY TEXT - FOOTER
I also only need to do this for one email, so if possible, I would like to add something like a custom token for Rules to embed the view, but I'm not sure how to go about that.