Posted by dtabach on September 19, 2007 at 6:01pm
Jump to:
| Project: | Send |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
What variables, besides %message and %body, can be placed in Email Template settings? Is there a way the subject of the email defaults to the title of the node being sent? Otherwise, is there a way to make the subject editable by sender?
Comments
#1
A little hack did the trick.
In the send.module, change lines 184 and 188 (they are equal) from
<?php return t('@name from '.variable_get('site_name','Drupal'),array('@name'=>$nodename)); ?>to
<?php return t($node->title); ?>The only problem is that, if someone creates a node, save it and then go back to edit it changing its title, the subject of the email being sent will remain the older one. You'll have to go to 'Send to Friend' section in the Edit page and remove the 'E-mail subject line', then the email's subject is updated.
I'd appreciate any hints on avoiding this problem or improving the code (I'm not a PHP programmer).
#2
Removing the default subject in send.inc prevents the problem
Around line 25, change:
'#default_value' => _send_value('subject', $module, $nodetype, $node),to:
'#default_value' => t(""), //remove default subjectThese are my first experiments on hacking a module. I've never studied PHP, I'm learning things from trial and error. Any advices would be appreciated.
#3
Consolidating discussion of templating values here: http://drupal.org/node/210739
If you'd like to provide a patch to add additional values or change behavior, please post it there.
Thanks!
#4