Hello, @Andrea - Thanks for reaching out! This should be a pretty straightforward implementation using String Functions, Control flow actions like Conditional, and some familiarity with how JSON data type is treated in Logic Apps.
If you provide info on how the subject line is exactly formatted and the easy way for you to maintain the static list of names, we can share with you a sample code of such workflow that you can use.