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
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

GiorgosK - January 29, 2007 - 15:43

sorry editor ate my html tags

there are lots of em tags in the body of the email and it looks bad

#2

mh86 - February 16, 2007 - 14:54

yes, it's independant from the contact module. I'll work on that as soon as possible!

#3

John Money - June 2, 2007 - 06:39

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

apt94jesse - March 12, 2008 - 02:10

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

gemini - May 31, 2008 - 18:45

I changed % to ! for the subject and wrapped the body variable into strip_tags() function - that did the trick for the whole email.

 
 

Drupal is a registered trademark of Dries Buytaert.