HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

All email notifications

SS ✭✭
edited March 2010 in Feedback
I have a need to intercept all email messages (for admins) which sent by Garden to users. I want to make it configurable, that admins can choose what users activity they want to watch.

class Gdn_Email extends Pluggable, that is good. My first thought was change Subject() to xSubject() for plugins... but Subject() may accepts dynamic data such as date, names, etc. for one activity type, so this variant is unacceptable.

I'm thinking about new method similar to Subject but accept first param TranslateCode (sprintf string), next params are params for sprintf.

function NewSubject($Code){
$Args = func_get_args();
$Code = array_shift();
$this->EventArguments['SubjectCode'] =& $Code;
// ....

Any other ideas?


  • Options
    MarkMark Vanilla Staff
    All emails are handled by the activities. You could add a field to the activity table that flags activity types that admins want to know about, and then just send the message to admins as well.
  • Options
    SS ✭✭
    Probably, I'm not exactly said what I need.
    I'm talking about all emails (not activities only) created by Gdn_Email.

    Just simple script.
    ->Subject('Test ' . date('r'))

    No AddActivity() or other tables here...
  • Options
    SS ✭✭
    If my script will use xSubject
    ->xSubject('Test %s', date('r'))

    Plugin handlers:

    But I dislike something in this idea, still thinking...
Sign In or Register to comment.