Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

.../languages/English/email_role_change.txt Question

edited August 2007 in Vanilla 1.0 Help
So .../languages/English/email_role_change.txt is the skeleton for all e-mails
sent upon "Role Changes", but the text is so dry as to be confusing to a less-than
sophisticated user of discussion groups, moreso when it is the first message
sent to an Applicant who has been approved.

Is it possible to have one template for each type of role change, so that the
text can be less generic, and more "friendly" to the new member?

This seems to be something that would require more coding than I would want
to attempt. I've looked at the various extensions, and I have found nothing.
Has anyone made their e-mails more "friendly"? Could they post what they
have done?

Thanks!

Comments

  • You know, I think you can now claim a bug found. People.Class.UserManager.php is where the emails are generated, and there is a delegate in place there to do the very thing you request. The only problem is that it is placed where it does no good, right after the email text is generated, but gives access to the raw email body text AFTER it has been used to generate the message that will be sent.
  • Actually, come to think of it, it would be better to change the passed email body to instead pass the whole email object.

    So change line 153 from $this->DelegateParameters['EmailBody'] = &$EmailBody;
    to $this->DelegateParameters['Email'] = &$e;

    And then to modify the message before its sent, your extension would look something like this:function ModifyMessage(&$Context) { $e = &$Context->DelegateParameters['Email']; $AffectedUser = &$Context->DelegateParameters['AffectedUser']; Switch ($AffectedUser->Role) { 'Douchebag': $e->Body .= 'Be nice or your new icon stays!!'; break; 'Master Administrator': $e->Body .= 'Play nice while I am out of town.'; break; } } $Context->AddToDelegate('ModifyMessage','UserManager','PreRoleChangeNotification')(warning: typed from known unreliable memory of syntax, all untested code)
  • So an extension would not be possible until the basic code is fixed per your comments?
  • edited August 2007
    I corrected the bug in UserManager::AssignRole so that it works like in UserManager::CreateUser. $this->DelegateParameters['EmailBody'] is now usable. Do you still need "$this->DelegateParameters['Email'] = &$e;"?
This discussion has been closed.