Can't use share/unshare deluge task with variable as a component name.

Can't use share/unshare deluge task with variable as a component name.

I am trying to write a function that takes an email address and a page name and share the page with the user.
I found that using the share/unshare task with a variable like this:
  1. componentName = "somePage";
  2. share view(componentName, email);
... causes an error, but this works:
  1. share view("somePage", email);

Is there a way to share/unshare pages without hard-coding all of my page names?