Mail to customers

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Mark

Mail to customers

Post by Mark »

Hi!

We are using Mantis 0.19.2. The following thing I want to achieve:

I'm working on a helpdesk and I want our users to be informed by e-mail when they report an incident.

At one hand, we have our IT employees. They are already in the system as reporters and managers etc. This can be configured easily by using the functionality of Mantis.

At the other hand, we have our customers. They report an incident with our helpdesk, and we then want to keep them informed by e-mail. I want them to receive the same update e-mails as we receive.
I can not easily add them to the mantis database because I can simply not add them to a separate 'list'.

Can anyone explain to me how I can achieve this?
Thanks in advance.

Regards from Holland.
Mark

is this possible?

Post by Mark »

Does anyone have an idea if this can be done through Mantis?

Thanks in advance!
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

I guess you could create a custom field for the reporter, and then use the custom_function_default_issue_update_notify(...) function to email them when any issue is updated?
Markus

Post by Markus »

Can you describe it more exactly?
Which files do I have to change?

thx for help
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

Firstly, you need to set up a custom field (eg. "Copy Email to:") that you will fill with an email address (or whatever).

Secondly, in custom_functions_inc.php in the root directly, write a function with the 'fingerprint' of:

Code: Select all

# --------------------
# Hook to notify after an issue has been updated.
# In case of errors, this function should call trigger_error()
# p_issue_id is the issue number that can be used to get the existing state
function custom_function_override_issue_update_notify( $p_issue_id ) {
}
This will override the current custom_function_default_issue_update_notify(...) function (that is blank by default, anyway).

This function will get called after the bug is updated, so you probably won't be easily able to get the email to be exactly what is sent to everyone else, however you can still send an email or whatever you want from within this function.

Basically what you need to do in your custom_function_override_issue_update_notify(...) function is:
1) Get the ID of the custom field that you are using. Call custom_field_get_id_from_name( $p_field_name ) where $p_field_name is obviously the name of the field that you are using to store the email address.

2) Call custom_field_get_value( $p_field_id, $p_bug_id ) where $p_field_id is the value returned in step 1 and $p_bug_id is the parameter passed in to the main function.

3) Use the returned value to do whatever you like. I would suggest looking into calling email_send( $p_recipient, $p_subject, $p_message ) or something similar.

I hope that makes a bit more sense for you.
Lincoln.
Markus

Post by Markus »

In which file can i set up a new costum field?


great thanks
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

Custom fields are defined from within the normal management windows: no coding necessary. As an administrator, you should be able to click through "Manage" to "Manage Custom Fields".

Having said all of that, I just noticed that you're on 0.19.2. I have a feeling custom fields were available in that version, but you *might* need to upgrade...
Post Reply