Seems so simple. I cannot figure it out or find where others have done it.
I am pretty new to PHP though.
I want Mantis, whenever any new issue is created, to send me an email. That is it. I need to know when ever a new issue is created by anybody. Not assigned, not changed, just as soon as a new issue is created.
Thanks.
Sending an email to a specific address on new issue creation
Moderators: Developer, Contributor
Re: Sending an email to a specific address on new issue creation
Hi
You have to create one file in mantis root directory named "custom_functions_inc.php".
In that file write this following code:
<?php
# --------------------
# Hook to notify after aa issue has been created.
# 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_create_notify( $p_issue_id ) {
$t_recipient = "send_to_email_address";
$t_headers = array();
$t_subject = email_build_subject( $p_issue_id );
$t_message = "your_message";
$t_email_id = email_store( $t_recipient, $t_subject, $t_message, $t_headers );
if ( OFF == config_get( 'email_send_using_cronjob' ) ) {
email_send_all();
}
}
?>
that's it.
Regards
Gaëtan Hermann
You have to create one file in mantis root directory named "custom_functions_inc.php".
In that file write this following code:
<?php
# --------------------
# Hook to notify after aa issue has been created.
# 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_create_notify( $p_issue_id ) {
$t_recipient = "send_to_email_address";
$t_headers = array();
$t_subject = email_build_subject( $p_issue_id );
$t_message = "your_message";
$t_email_id = email_store( $t_recipient, $t_subject, $t_message, $t_headers );
if ( OFF == config_get( 'email_send_using_cronjob' ) ) {
email_send_all();
}
}
?>
that's it.
Regards
Gaëtan Hermann
Re: Sending an email to a specific address on new issue creation
Hi,
this script works fine! I wonder if there is a way to use it with variable email addresses...? I want to use a new custom field (email) and send the notification mail to this address. I was trying half a day but was not able to solve this problem. Any idea...?
thanx
Johannes
this script works fine! I wonder if there is a way to use it with variable email addresses...? I want to use a new custom field (email) and send the notification mail to this address. I was trying half a day but was not able to solve this problem. Any idea...?
thanx
Johannes