View Full Version : How to have a prefix on every email set?
JoshFink
07-02-2002, 09:35 PM
I would like it so that when an email is sent from the system it is prefixed by a phrase of my choosing, like "Community Message -" and then it adds the true subject after that.
I think a lot of people have junk mail features in their email or just ignore emails where the subject doesn't catch them.
Where would I put this code? Which file? I've been searching.
Thanks
Josh
Admin
07-03-2002, 06:25 AM
You can edit each emailsubject_ template and add that.
Admin
07-03-2002, 06:28 AM
You can also run this template to it automatically:
UPDATE template SET template = CONCAT('Community Message - ', template) WHERE title LIKE 'emailsubject%';
JoshFink
07-03-2002, 12:41 PM
Thank You... That helps out a lot.
One more question. Say I wanted to include the text that I was going to use in a file (for instance the config.php file used for vbPortal). How would I go about doing that?
Thanks
Josh
Admin
07-03-2002, 02:45 PM
That would be a lot harder, you'll need to trace down every call to mail() in vBulletin, make sure the config variable can be used there (you might need to globalize it) and use it in the templates.
JoshFink
07-03-2002, 04:04 PM
Thanks. I've got some things I'm going to work on. I can always fall back on the easy way.
Josh
Tralala
08-16-2007, 06:59 PM
How can I do this with 3.6.x? (I'm not seeing any "emailsubject_" templates.)
Specifically I'd like to add a default prefix for emails sent out via the AdminCP -> Users -> "Send Email to Users" function. (It's email.php in the admincp folder, if that helps.)
I'd like those emails to have my forum name as a prefix, so users can consistently find/filter them.
Paul M
08-16-2007, 07:35 PM
Wow, impressive five year bump.
You can use the "mail_send" hook to update the subject (and other parameters) before a mail is sent.
Tralala
08-16-2007, 09:48 PM
Wow, impressive five year bump.
Thanks! I was a good boy and did a search. :D
You can use the "mail_send" hook to update the subject (and other parameters) before a mail is sent.
Thank you. Can you please also tell me how to edit the mail_send hook?
I know how to edit templates, phrases and plugins, but haven't yet deal with hooks. I'm self-taught with all things vBulletin and have gotten along fine for awhile now. I follow instructions well. Any notes on how to use the mail_send hook to add a prefix to these emails, would be appreciated. :)
Tralala
09-09-2007, 02:47 PM
You can use the "mail_send" hook to update the subject (and other parameters) before a mail is sent.
Any help on how to do this?
Paul M
09-09-2007, 06:08 PM
Sorry, I never saw your previous reply.
If you know about plugins then you must know about hooks - when you create a plugin you link it to a hook.
Create a plugin, linked to the mail_send hook and just add php code to change the variable $subject as required.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.