Drupal Association members fund grants that make connections all over the world.
I have a webform working fine and sending email with the user ID and IP address included in the email body and subject line, but if the user is anonymous, it won't print "Submitted by anonymous user", or the IP address, in either place. This code seems to be failing:
<?php if ($user->uid): ?> <?php print ($email['html'] ? '<p>' : '') . t('Submitted by user: %username') . ($email['html'] ? '</p>' : ''); ?> <?php else: ?> <?php print ($email['html'] ? '<p>' : '') . t('Submitted by anonymous user: [%ip_address]') . ($email['html'] ? '</p>' : ''); ?> <?php endif; ?>
All of the other custom fields print out fine in the email body.
I attached the custom file: webform-mail-19789.tpl.php (renamed webform-mail.tpl_.txt)
What's wrong? I couldn't find any configuration options governing this.