Hello Message team, is there a way to reference an unknown number of entities when printing message text?
My scenario is this: I am using the Relation module, and linking the relation itself to my message as an entity reference field. No problem, works fine.
Where I'm running into trouble is trying to print the message text. I'd prefer the text to read 'Relation author X
created relation Y
between related entities 1
, 2
, ... n
', where n is the number of entities related by Relation Y.
The problem is I don't necessarily know how many entities will be related by the Relation, so the only way I can think to pass this information to message text is through an array variable ... which does not appear to be doable through Replacement Tokens.
I think that means this needs to be done through code, but I'm unsure how message text can be accessed through the Message API.
In hook_entity_insert, can you do something like $wrapper->message_text->set('This is message text for Relation entity $x')
?
Comments
Comment #1
bluegeek9 CreditAttribution: bluegeek9 as a volunteer commented