How to add custom email to account user emails? There are a few email templates in account user emails page: "/admin/config/people/accounts".

How can i add custom emails from my own module? I would like to have&amp;edit all email templates in the same place.
This form is defined in core user module, user.admin.inc file:

/**
 * Form builder; Configure user settings for this site.
 *
 * @ingroup forms
 * @see system_settings_form()
 */
function user_admin_settings() {


Particularly, line 444 starts email template section:

$form['email'] = array(
    '#type' =&gt; 'vertical_tabs',
  );
  // These email tokens are shared for all settings, so just define
  // the list once to help ensure they stay in sync.
  $email_token_help = t('Available variables are: [site:name], [site:url], [user:name], [user:mail], [site:login-url], [site:url-brief], [user:edit-url], [user:one-time-login-url], [user:cancel-url].');

  $form['email_admin_created'] = array(
    '#type' =&gt; 'fieldset',
    '#title' =&gt; t('Welcome (new user created by administrator)'),
    '#collapsible' =&gt; TRUE,
    '#collapsed' =&gt; (variable_get('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL) != USER_REGISTER_ADMINISTRATORS_ONLY),
    '#description' =&gt; t('Edit the welcome e-mail messages sent to new member accounts created by an administrator.') . ' ' . $email_token_help,
    '#group' =&gt; 'email',
  );
  $form['email_admin_created']['user_mail_register_admin_created_subject'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Subject'),
    '#default_value' =&gt; _user_mail_text('register_admin_created_subject', NULL, array(), FALSE),
    '#maxlength' =&gt; 180,
  );


As you can see, there is no foreach, no external hook call, nothing. Just raw fields hardcoded. The only way is to add your fields using hook_form_alter(). Make sure you also add your validators and submit handler to take care of your new fields, because user module will not do it for you.