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?
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
Comment #1
dtabach commentedA 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).
Comment #2
dtabach commentedRemoving 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.
Comment #3
jerdavisConsolidating 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!
Comment #4
gohel raj commented