Closed (outdated)
Project:
HTML Mail
Version:
7.x-2.8
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
24 Oct 2011 at 19:24 UTC
Updated:
29 Sep 2020 at 20:27 UTC
Jump to comment: Most recent
I would like to add a parameter to my tpl file. I can see, for example, the list of user parameters available. I am not sure the code for getting the parameter into the email. So, if I want:
Greetings [name]!
How do I do that in the tpl.php file?
Thanks,
Maria
Comments
Comment #1
pillarsdotnet commentedYou're looking for token support, I think.
Comment #2
mariagwyn commentedHm. possibly. Or just the field code.
Comment #3
pillarsdotnet commentedFind the module that is calling
drupal_mail()and look at the fifth parameter. If the calling module provides a user id, or user object, or other user-type context, then the template file can access it via the$paramsvariable. If the calling module does not provide such info, then you might want to try something like this:This of course assumes that the email recipient address is associated with a user account.
I'm probably going to mark this "Won't fix" because the above code properly belongs in the sending module's
hook_mail()implementation.Comment #4
pillarsdotnet commentedClosed as duplicate: #1314920: Using HTML Mail Module, how to link product from the shopping list email to its individual product page?
Comment #5
pillarsdotnet commentedOkay, the above info needs to be added to documentation.
Comment #6
salvis