By esmailzadeh on
if yes how can i do that?
i find mime email module that make available html email for drupal modules.
how we can use this with webform and how can i theme webform output?
if yes how can i do that?
i find mime email module that make available html email for drupal modules.
how we can use this with webform and how can i theme webform output?
Comments
modify the headers
just add this code to your template.php file in your theme directory:
this is the theme_webform_mail_headers from the webform.module file. all i did was change the content-type from "text/plain" to "text/html". works like a charm...hope that helps!
Can this code be targeted to
Can this code be targeted to only send certain webforms as HTML ?
edit - just tested and the above code does seem to work :)
How can I fix so I can use
How can I fix so I can use "åäö"? I tried changing the UTF-8 to ISO-8859-1 instead but to no success.
When I try this in my
When I try this in my template.php, I get the error
Parse error: syntax error, unexpected '[', expecting '(' in ...template.php on line (where the function is)
So it seems it's disliking that I'm trying to specify the nid - did this not cause any problems for you?
Syntax error
You just have to delete [ and ].
For example, if your node id is 6, the code should be :
phptemplate_webform_mail_message_6
Spam Mail
i have used this code for my particular webform.everything is working fine but after using this now mail is going in spam folder.
Any Solution!!!!!
Webform email as HTML targeting code
I'm using your snippet here in my template.php to send a webform submission as HTML email. It is working for me but I get warning: Missing argument 4 for phptemplate_webform_mail_headers_3() in /home/hcssgb/public_html/sites/all/themes/at_hcss/template.php on line 179. when I submit a webform.
line 179 is
function phptemplate_webform_mail_headers_[NID-HERE]($form_values, $node, $sid, $cid) {Any idea on how I could clear this?
What if your theme doesn't
What if your theme doesn't have a template.php file?
Then just create one and put
Then just create one and put that function in it.
sending webform in html format
Hi everybody,
I've been working on the e-mail formatting for a while now and everything is coming into place.
Only problem is that the links I receive in my e-mail aren't clickable after adding the code in my template.php file
I added as suggested, the following:
function phptemplate_webform_mail_headers($form_values, $node, $sid, $cid) {
$headers = array(
'Content-Type' => 'text/html; charset=UTF-8; format=flowed; delsp=yes',
'X-Mailer' => 'Drupal Webform (PHP/'. phpversion() .')',
);
return $headers;
}
Any ideas on how to get the links, for example; "the result can be viewed at..." or "links of images" clickable?
Thnx in advance.
I get an error, but it still works..
This is great, thank you. However I get this error on the confirmation page after submission:
It still submits and works fine, but an error obviously shows to people which I'd prefer it didn't...
Anyone have a clue as to why this could be happening?
I've got the same issue...
I've got the same issue... Did you already find a solution for this problem?
If it works fine, why not
If it works fine, why not just hide the errors for the public with css?
I think you are using Drupal
I think you are using Drupal 7 and d7 version of webform.
Now all theme functions only receive one variable, an associative array
So it is:
FOR DRUPAL 7
Newline breaks?
I added this function, and it looks like I am getting html, but there are no line breaks. Here is what the output looks like:
Submitted on Sat, 06/11/2011 - 08:47 Submitted by user: Kenny Acock Submitted values are: *1. Match the definitions to the appropriate Developmental Domain: ** A) The process of getting to know and value other people in their lives. Learning to share, cooperate, take turns and negotiate with others. B) The feeling people have about themselves, other people in their lives, and the environment in which they live. C) Gradual gaining of control of large and small muscles. Acquiring large muscle skills such as sitting, and small muscle skills such as pinching. D) The process of learning to think and to reason. E) Development of daily living skills such as toileting, self feeding, dressing and so forth. F) The process of learning to communicate with others through verbal or other communication means. 1a: cPhysical Development 1b: bEmotional Development 1c: eSelf Help 1d: aSocial Development 1e: dCognitive Development 1f: fSpeech/Language Development 2. Number the stages of development in the order that they occur: 2Age of Exploration 2b: 3Early Elementary 2c: 4Pre-adolescence 2d: 3Preschool 2e: 5Adolescence 2f: 1Age of Dependence 3. All people develop the same way, at the same time.: False 4. The skills developed during the age of dependence are the foundation for all later development.: True 5. In the Adolescence stage, emotions are calm, controllable, and rational.: False 6. Knowing the predictable sequence of behavior helps parents, educators and other professionals to develop individualized programs.: True 7. During the Age of Dependence developmental state, children learn skills necessary for them to (a)_______________, (b)_______________ and (c)_______________ themselves.: (a)feed 7b: (b)cloth 7c: (c)toilet *8. During this phase, children tend to be self centered, but they also need companionship, and need to be able to play with children the same age. Their attention spans are short and they can be easily diverted. They always seem on the go, and learning about their new world. They require a great deal of attention and support from adults. Which phase is this? ** 8a: Preschool Phase *9. During this phase, children tend to experience rapid growth and body changes which are likely to be accompanied by periods of fatigue. It is not uncommon for them to experience feelings of self-consciousness, shyness and insecurity. During this period, their peer group has more influence over them than any other group. Which phase is this? ** 9a: Adolescence *10. During this phase, children have mastered many more skills and language. They will begin jumping off of furniture or riding a bike. Children will spend more time in active play at the beginning of the phase. Children understand longer and more complicated sentences that are said to them. They are using the skills they have learned to finish routines, but they want to continue at their own pace and make the choice of when, and how, to do each routine. Which phase is this? ** 10a: Exploration Phase The results of this submission may be viewed at...
If you're using the SMTP
If you're using the SMTP module remember to enable 'Allow to send e-mails formated as Html'
Not sure why...
$cid is argument 4 and it may not be necessary? Using Drupal 6.20 and webform 6.3.9 I deleted the $cid argument from the function and it seems to have worked.
so the function I used to drop the error:
with webform 6.3 the function
with webform 6.3 the function has changed to:
although not necessary now with HTML format available within webform 6.3, it could still be used to override text format
where can I get variables
And where can I get variables in $form_values like $form_values['submitted_tree'] or $form_values['details']
I looked this in $_POST array
I looked this in $_POST array
Its working with 6.22 and
@brantwynn
Its working with 6.22 and webform 6.x-3.11. After clearing cache just edit your e-mail and put code in
<body>your code, inclunding Tokens </body>Send HTML using Mime Mail
I tried to send HTML emails with the method mentioned above with no luck. You can force webform module to send HTML emails by installing mimemail, and mailsystem modules. They'll add a checkbox to support HTML below email template field in webform. Very easy integration.
Mime Mail - body message
Well I am trying to use Mime Mail and I am getting code in the body. Here is more information.
https://drupal.org/node/2216763
Thanks.
<?php'X-Mailer' =>
phpversion() WOT WOT WOT?! maybe we should put there our admin password...?
What's the big deal with php
What's the big deal with php version? See "should I remove CHANGELOG.txt" conversations here.
What's new and changing in PHP 8.4
Drupal 7.x makes this easy
I'm using Bartik-Plus as my theme (allows for drop down menus), and had added the code above to get the HTML formatting working. I was then getting a whole heap of missing attribute errors and wondering why. Found out that the code here applies to webform 6.x and not 7.x
When I looked at the template.php for the Bartik theme, I found the code that was causing the error. I checked the Bartik-Plus theme and found that it already had the formatting for the HTML mail built in. When I remarked out the 6.x code, the emails worked perfectly. Thanks for helping me to find this error. :)
Slight Change For Drupal 7
Just to confirm what hazmoid has said... Drupal 7 is slightly different, unless your theme has already done this for you....
My theme wasn't automatically set-up for HTML and I didn't want the bulk of the extra modules just to change a few lines of code, so here's the solution I used...
You'll notice that I've used
MYTHEMENAME(which should be changed to the name of your theme) instead ofphptemplateand also the only value passed into the function is$variablesrather than$form_values, $node, $sid, $cid....Hopefully anyone using D7 will find this useful...
Confirmed
Just confirming that this fix did work for me (D7.x)
Also, a note that this obviously applies to all Webform headers (not a problem in my case, but definitely something to watch for)
See Webform module folder's
See Webform module folder's THEME.txt file there was a template suggestions to set headers per Webform (node ID) if I can remember.
What's new and changing in PHP 8.4
Quick and verry verry verry nasty!!!
Don't do this but in a pinch ...
go to the "thank you page " where you go to after you submit the form where you can see in the url yoursite.com/thankyoupageurl?sid=1234
the ?sid get var
then make your site have php input filter ...change the thank you page to php format (WARNING !!!)
then ...
you will need the component id for name and email found in the webform when you click edit on a feild component eg node/NODEID/webform/components/CID
This code seems to do the
This code seems to do the job... But I'd never do this!
Someone can trigger emails by just loading the thank you page with different sid as many times he wants.
What's new and changing in PHP 8.4
style webform labels
This comment thread works great for D7 except for the fact you can set any specific styles on labels..do i need to open a new issue or does anyone know a way to add markup to your rendered webform labels.
thank you to everyone for your help already.
Argument #2 is not an array
EDIT: Scratch this. The issue is Drupal.