How to call function in mail which is configured using Rules in drupal
You can alter the mail content using hook_mail_alter


  hook_mail_alter() allows modification of email messages created and
  sent with drupal_mail(). Usage examples include adding and/or changing
  message text, message fields, and message headers.