Question: I am trying to make a plugin which lists all users from a database with for each user a button to send an email to them. So the only way I can get with their username their email adress is to use the $POST which is given after the button is clicked. With their username I can search the db table to retreive the email. The problem here is that the page will reload and the function wp\_mail is called before the pluggable.php has loaded its functions.
Here is the post:

```
if ($_POST) {
    sendEmail(current(array_keys($_POST)));
    echo "<script type='text/javascript'>alert('Email is sent!')</script>";
}

```

And here is the function:

```
function sendEmail($username) {
    global $wpdb;
    $user = $wpdb->get_row("SELECT email, firstname from wp_site_users WHERE username ='" . $username ."'" , ARRAY_A);
    $mail = $wpdb->get_row("SELECT * from wp_send_email WHERE id='1'", ARRAY_A);

    $to = $user['email'];
    $subject = 'Hello!';
    $message = $mail['header'] . $user['firstname'] ."\n";
    $message .= $mail['content'] . $username . "\n";
    $message .= $mail['footer'];

    $headers = 'From: '.'test@test.com'."\r\n";
    echo $to . "<br>" . $subject . "<br>" . $message . "<br>" . $headers; 
    wp_mail($to, $subject, $message, $headers);
}

```

I've tried to add `add_action( 'plugins_loaded', 'sendEmail' );` at the header but that doesn't seem to work. 
Any ideas?

Answer: 
Without using `typedef` or `using` then it's not possible to access to the container's type. However you can specialize the `bar` function where you know what the container's type is.

```
template<> void bar<Parent::Inner>()
{
  // Here, you know what the parent is
}

```
With a simple `using`:

```
struct Parent
{
  struct Inner
  {
    using parent_type = Parent;
  };

};

template<class T>
void bar()
{
  //here I would like to get T's parent type
  typename T::parent_type t;
}

```

Also note that `bar<Inner>();` is ill-formed. You need

```
bar<Parent::Inner>();

```