How to use url() correctly? I'm trying to generate a custom token to a prepopulated URL.  My code looks like this:

        $replacements[$original] = url('user/login', array(
          'query' =&gt; array('edit[name]', $account-&gt;mail),
          'absolute' =&gt; TRUE,
        );


The resulting URL looks like this:

http://example.com/en/user/login&amp;edit[name]=myemail@example.com

But the &amp; should be a ? because it's the start of a query string.  What am I doing wrong?
This should work for you:

    $replacements[$original] = url('user/login', array(
      'query' =&gt; array('edit' =&gt; array('name' =&gt; $account-&gt;mail)),
      'absolute' =&gt; TRUE,
    ));


Sidenote: you are naming the argument as name but you are passing the mail.