Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorjfischer
    • CommentTimeMay 15th 2007
     # 1
    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!
    •  
      CommentAuthorWallPhone
    • CommentTimeMay 15th 2007
     # 2
    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.
    •  
      CommentAuthorWallPhone
    • CommentTimeMay 15th 2007
     # 3
    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)
    • CommentAuthorjfischer
    • CommentTimeMay 15th 2007
     # 4
    So an extension would not be possible until the basic code is fixed per your comments?
    •  
      CommentAuthorWallPhone
    • CommentTimeMay 15th 2007
     # 5
    Yep.
    •  
      CommentAuthorDinoboff
    • CommentTimeAug 24th 2007 edited
     # 6
    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;"?
Add your comments
    Username Password
  • Format comments as