View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0022225||mantisbt||feature||public||2017-01-20 08:28||2017-02-28 04:35|
|Summary||0022225: New Event to change email address of a user by project|
I'm currently developing a pluging to have generic users linked to multiple projects but having an email address different depending of the project the user is assigned on.
I use the normal user table and store the informations user_id, project_id and email in a plugin table
So I think that the simpliest way is to change what the user_api function return, when mantis try to get the email address, by the email address configured in my plugin.
To be in cohesion with mantis and to give better possibilities to futur plugin, I suggest to add a new event:
which may be send in user_api.php in user_get_field()
What is your opinion on this ?
|Tags||No tags attached.|
Didn't have a deeper look, but this will introduce unwanted side effects.
also, may mess with login functions based on email
If it's intended to have more control over notifications, I suggest to work on the notification functionality
Which works by allowing to include and exclude users in a notification process.
My proposal was, roughly:
This has to be detailed better, but as a start, i think would be a good addition that wont break any core functions, and allow implementation of several functionalities like:
Thanks for your responses.
Your proposal seems to meet my needs so I looked in the code and I suggest something like that :
'EVENT_EMAIL_RECIPIENT' => EVENT_TYPE_CHAIN,
And for when to send the event I think email_store() in email_api.php is the best option :
Is there others ways to send email than to pass throught email_store()?
I also saw email_collect_recipients() which better fit to your proposal but the problems are :
What do you think about this ?
I did the modification on my side with just these two lines.
I just changed the event signal to add the subject to the event and that give :
And it's work fine in MD5 and LDAP configuration.
Can you consider adding this EVENT in the future ?
As for the functionalities you proposed @cproensa I believe an EVENT with the EmailData object in parameter allow these implementations
My proposal :
In email_api.php->email_store() :
it's can be used for
If you prefer this option I can adapt my code without any problem.
I can also provide my plugin if you want but I precise that the users linked in my plugin are abstract and can represent differents entities depending of the project which is why I need an email address by project.
@kevcrou certainly interested, but no time to have a look at it.
I'm glad that you're interested in my work so I left it in attachement.
Since my PR is not accepted yet, to use this plugin you have to modify the code just like it's done in the PR in the above post.
GenericUsers.zip (27,490 bytes)
@kevcrou Thank you for the plugin.