Skip to content

Support placeholders in Broadcast messages

Nicolas Dular requested to merge nicolasdular/broadcast-variables into master

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

Screenshot_2020-03-03_at_18.52.57

HTML

Screenshot_2020-03-03_at_18.53.09

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Michael Kozono

Merge request reports