Hook for the "Welcome (awaiting approval)" email I need to modify the email for "Welcome (Awaiting Approval)."

I know I can use hook_mail_alter(), but I don't know what the ID is for "Welcome (Awaiting Approval)," nor do I know how I can directly access a user's profile2 fields.

I assume I have to do something like:

function module_mail_alter(&amp;$message) {
  if ($message['id'] == 'welcome_waiting_approval') {
    global $user;
    $fid = $user['firm']['firm_id'];
    $message['body'][] = "Your Firm's ID is: $fid";
  }
}
I have used the Maillog / Mail Developer module to debug things such as your question.

To find the message ID, simply use code similar to the following one:

function YOURMODULE_mail_alter(&amp;$message) {
  dpm($message['id']); // Assuming Devel module is installed.
  // Or just ...
  print $message['id']; exit;
}


Hooks are run for every module they are declared in; if you don't know the message id, simply create the hook and output the message id it finds. (Exiting might actually be a bad idea if your sending many types of messages—you didn't state that—because then the code might stop short of the exact message ID you're searching for.) Since the hook is declared, it will run for each outgoing message.

To access the user's 2 profile fields, they are just fields as long as you have a user object you can access them:

function MYMODULE_mail_alter(&amp;$message) {
  global $user; // Get's a reference to the logged in user.
  if ($message['id'] == 'welcome_message_approval') {
    $message['body'][] = t("Your Firm's ID is: @firm", array('@firm' =&gt; $user-&gt;firm);
  }
}


To easily access fields I recommend the Field data extraction module.

I believe the Profile2 module should "eagerly" load the profile fields. If they are not in the global user object because of lazy loading, then you should be able to get at them by calling field_attach_load().