field_email linked to contact_form
GiorgosK - January 29, 2007 - 15:41
| Project: | Email Field |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
produces an email with html tags included like this:
---------------------------------------------------------
[Title of post - Email] subject of email
username sent a message using the contact form at
http://www.example.com/drupal5/email/12/field_email.
body of email
---------------------------------------------------------
is it supposed to act this way ?
I checked and the regular contact form does not behave like this (its probably independent ? I am not familiar )

#1
sorry editor ate my html tags
there are lots of em tags in the body of the email and it looks bad
#2
yes, it's independant from the contact module. I'll work on that as soon as possible!
#3
Problem is improper (or actually changed) use of the t function. Substitution with %variables will now add the <em> tags via theme_placeholder(). Should be using !variables instead, so for example:
- $subject = t('[%title - %contact] %subject', array('%title' => preg_replace("/\r|\n/",'',$node->title), '%contact' => $types['fields'][$fieldname]['widget']['label'], '%subject' => $edit['subject']));
+ $subject = t('[!title - !contact] !subject', array('!title' => preg_replace("/\r|\n/",'',$node->title), '!contact' => $types['fields'][$fieldname]['widget']['label'], '!subject' => $edit['subject']));
#4
changing the % variables to ! variables didn't work for me, but adjusting the line in the includes/theme.inc file did. Just take out the
<em>tags.#5
I changed % to ! for the subject and wrapped the body variable into strip_tags() function - that did the trick for the whole email.