I created a report button which works! It needs to also grab the url where it was clicked so moderators know where needs to be moderated.
The issue is Discourse wipes the raw body when the composer loads, so our iframe handler only sets recipients/subject and the text never sticks; we need to set composer.model.raw (or pass raw in composer.open) after the composer initializes to keep the event URL.
Discourse resets composer.model.raw after opening, so the event link you pass in gets wiped; we need to set composer.model.set("raw", prefill) inside the postMessage handler right after the composer is ready.
Probably it only happens if we set composer.model.raw after the composer opens so we need to switch to using a composer template or preset before render so we don’t mutate it post-load.
