Support placeholders in Broadcast messages
What does this MR do?
Issue: gitlab-org/growth/engineering#2603 (closed)
We want to add variables to our broadcast message that are dependent on the user.
Admins now can create broadcast messages that includes the user's id, name, email, username or the instance ID.
We use curly brackets as an indicator for placeholders, however since the broadcast message already ran through a pipeline which encodes links, we also need to support %7B%7B
and %7D%7D
as placeholder for URLs. ({{email}}
gets encoded to %7B%7Bemail%7D%7D
).
An example message would be:
Hi {{name}}, would you like to participate in our survey?
<a href="linktosurvey.com?email={{email}}&instance_id={{instance_id}}user_id={{user_id}}">Click here</a>
This feature is behind a Feature Flag broadcast_message_placeholders
.
See it in action: https://www.youtube.com/watch?v=2NKsXgfLhqc&feature=youtu.be
Screenshots
Preview of the message
HTML
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
-
Documentation (if required) => Follow up issue #209092 (closed) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
Edited by Michael Kozono