The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CPanel Plugin - Just a Link - But how to get Email Address?

Discussion in 'cPanel Developers' started by haberman13, Apr 23, 2012.

  1. haberman13

    haberman13 Registered

    Joined:
    Apr 23, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello fellow CPanel'ers, quick (and noobish) question.

    I wrote a plugin, which simply goes to a livephp page where I populate a text field with the user's email address. On submit it sends a GET to my server where I capture the email address and setup an account.

    I'm hoping to remove the livephp page and have the plugin just become a 'one click' that sends the GET email address to my page. Is that possible? The only way I see how is doing a location.href in the plugins javascript field when creating the plugin; if that is the case, is there a way to get the user's email address in the javascript?

    Thanks for any help or pointers you can give me.
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    unless you have a special Branding package, what you describe is not very doable.

    The cPanel interface is drawn using the Dynamic UI System, wish is kinda like a big hash table. When you register a cPanel Plugin, there's an 'include' of sorts created that extends the default 'hash table' to include a reference to your icon. These Dynamic UI entries are not very flexible. You'd have to fashion an entry with a very complex 'acontent' value that would retrieve the email address and submit it. I'm not even sure if it's technically possible for such a value entry to survive the Dynamic UI parser.

    The only other technical option I see left to achieve what you want is to have custom Branding too. With custom Branding you should be able to include custom JS code. Have the JS code alter the DOM so that there's a onclick event for the icon...you could use the Remote API to fetch the email when making the onclick event.

    All that said, I kinda scratching my head about the user experience that would come from your one-click scenario...firstly, would the user know that their email address was being transmitted? If that is not made clear prior to soliciting action, you could be walking a fine line with privacy concerns. Next, what happens when they click it? it just makes a JS call, but are they redirected to your site? how do they know that something was done...or when it's finished. What if they forget if they've clicked it before, what will happen when they click it more than once?

    ...My point is that while marketing research may say that more than one click causes N*10th number of users to become dis-interested, in IMO a minimum of two clicks is not too much to ask or expect. Having a navigation click to take them to a page that you have control over, it's content, etc provides you, the Business, the opportunity to assert your brand, services, and integrity.

    Best Regards,
    -DavidN
     
  3. haberman13

    haberman13 Registered

    Joined:
    Apr 23, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you very much for the response, truly helpful.

    OK, I'll have to re-work some of this, again - thank you!
     
Loading...

Share This Page