Needs review
Project:
Workflow-ng
Version:
5.x-2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Sep 2007 at 01:37 UTC
Updated:
22 Mar 2009 at 17:19 UTC
Jump to comment: Most recent file
Comments
Comment #1
jereme.guenther commentedI guess it would be nice to display my hack for others in case they want to implement it before it becomes part of the project:
In file:
workflow_ng_actions.inc
On line:
258
Is a function called:
function workflow_ng_action_mail_to_user($user, $settings, &$arguments, &$log)
In that function is this line:
if (drupal_mail('workflow_ng_action_mail', $to, $subject, $message, $from)) {
replace it with:
$headers = array(
'MIME-Version' => '1.0',
'Content-Type' => 'text/html; charset=UTF-8; format=flowed',
'Content-Transfer-Encoding' => '8Bit',
'X-Mailer' => 'Drupal'
);
if (drupal_mail('workflow_ng_action_mail', $to, $subject, $message, $from, $headers)) {
----
I am not sure how accurate all the settings are, but the sent emails ended up as html so it seems to have worked. If anyone sees errors in the $headers array please point them out, I copied it almost directly from Drupals documentation; I just changed "text/plain" to "text/html".
Comment #2
fagoindeed, this would be a great feature. It would be cool if you could provide it as patch, so that one can optionally select to send it as HTML!
Comment #3
jereme.guenther commentedI would if I could, but I am new to Drupal and all the software and methods they use.
I don't know how to make a patch for it. It looks like I would use some sort of CVS software. Do you know of a good version for Ubuntu Linux?
Comment #4
fago-> http://drupal.org/patch
in ubuntu the easiest way to create a patch is probably to use the "diff" tool -> apt-get install diff
then just make a diff between the latest workflow-ng snapshot and your modified version, the output is the patch
CVS can be used too for creating patches, it's more convenient if you are creating patches frequently.
Comment #5
j0rd commentedHas this feature been implemented in the latest workflow-ng?
I need to be able to send HTML emails.
Comment #6
jbomb commentedThe following patches add a select box for email format on the workflow "send an email to an arbitrary address" and "send an email to a user" configuration pages. This allows an administrator to send an email in either text/plain or text/html formats.
The patch was originally rolled against the 5.x-2.1, but I've been able to apply it to both 5.x-2.1 and 5.x-2-dev.
Comment #7
jbomb commentedComment #8
fagothanks.. please watch out for tabs in your code - only use spaces for indentation. Also you shouldn't pass the mime setting through token, as one can't use tokens there. Use
return array('mime' => value) + workflow_ng_token_get_settings(..);Comment #9
j0rd commentedset expandtab for vim ... if you happen to use it. Set tabstop=N and set shiftwitdth=N are two other commands you can look at as well. http://wiki.linuxquestions.org/wiki/Vim
I'm looking to use this as well, so I think I might merge the patch into my code. I'll let you know if I run into issues.
Thanks jbomb.
Comment #10
jbomb commented@j0rd how is this working out for you? any trouble? I've been using it on one of my sites with no problems.
@fago If you're interested in adding this functionality I can re-roll this against the current dev snapshot and remove replace the tabs with spaces and the following line :
with
per your suggestion.