That's right. I think the preferred way to do this (that I am aware of) would be to have a "parent" R Markdown document that "renders" a child and then attaches the result to an email. You can then use the pattern referenced there in your link (updated reference here: https://docs.rstudio.com/connect/user/rmarkdown/#r-markdown-output-files).
There is a way to change the output file of an Rmd from within the Rmd itself, but it seems that this approach does not work on RStudio Connect. However, for your edification it is discussed here:
I'm definitely curious to see if anyone has any other thoughts on how this approach might work! One reason that I suspect Connect enforces the file name convention is that Connect does some network routing to be sure you "see" the right thing in the browser when you visit the app directly. (i.e. it redirects you from /my/app/path
to /my/app/path/myfile.html
).
I recognize that this is not an ideal workflow, but setting up the parent document and running render()
from there is not a whole lot more work and should give you the flexibility that you are looking for! Please report back how it goes, or if you run into any trouble implementing!!