The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Hi there,
does somebody knows a elegant way to use custom fields in the subscription mails? I have to send Mails with the users real name like "Dear John, there are new replies ...." In Lang & Phrases -> Email Body Text -> notify, there are only the variable $touser which doesn't contains any custom user fields. $vbulletin->userinfo[field5] only give me the custom field of the user who has post the reply by whom the subscription notification was initiated. Greetings for every advices Bundschuh |
|
#2
|
|||
|
|||
|
There are two ways of doing that that I can see (I don't know if either would qualify as "elegant"): One would be to edit the file includes/functions_newpost.php and change the query that finds the users (around line 1186). You could add a JOIN of the userfield table, and add the fields you want to the fields being selected, then they should be available in $touser.
The other way would be to write a plugin using hook newpost_notification_message and write your own query to get the field. This way you're not modifying any files, but it would add 1 query per subscribed user every time someone posts. |
|
#3
|
|||
|
|||
|
These were also my first thoughts.
Using of hook location is more "elegant" than direct code modification. ![]() But in this case, I thinks it's not the fastest solution. I tried to get the custom field with PHP Code:
Also I can't simply str_replace the username in the template with the fetched custom field because the template will be rendered after the hook location . So I have to use the loaded template in array $evalemail[$touser['languageid']] and write back my changes... |
|
#4
|
|||
|
|||
|
Quote:
Quote:
|
|
#5
|
|||
|
|||
|
Quote:
Quote:
PHP Code:
PHP Code:
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|