Do not send "welcome" emails on first submission

This plugin allows you to report an issue in MantisBT by sending an email to a particular mail account

Moderators: Developer, Contributor

Post Reply
WWY
Posts: 15
Joined: 13 Oct 2023, 15:43

Do not send "welcome" emails on first submission

Post by WWY »

Is it possible to "turn off" the feature of sending the "welcome and register" email from first time submissions? I want to record the email address but not grant access automatically through the registration link. That way, the user registry becomes sort of a contact book. If the user later wants/needs access, we can grant it by using the Password Reset function.

I haven't gone into the code, but if it's a simple matter of commenting out a few lines, I can do it if guided (and of course, make a note to reapply the change when the product is updated :wink: ).
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: Do not send "welcome" emails on first submission

Post by SL-Gundam »

Go into user_api.php
Go to the function user_create
Disable the line near the end of this function with function call email_signup

This will disable the email for all user creations which use this method for creating the users

Another solution would be to use EmailReporting's ERP_set_temporary_overwrite to modify a variable only for EmailReporting

Add

Code: Select all

ERP_set_temporary_overwrite( 'send_reset_password', OFF );
Before this line with the user_signup function call: https://github.com/mantisbt-plugins/Ema ... i.php#L760
WWY
Posts: 15
Joined: 13 Oct 2023, 15:43

Re: Do not send "welcome" emails on first submission

Post by WWY »

Thanks for the quick reply. I didn't have my "notify me" setting so I'm late in responding.

"Plan B" is best since I don't want to turn off all emails. However, placing the "ERP_set_temporary_overwrite" immediately before

$t_reporter_id = user_get_id_by_email( $p_parsed_from[ 'email' ] );
(line 760 in the code)

did not do the trick. A "support" email from an unregistered user still sent the "sign up" reply. An I doing this correctly?
WWY
Posts: 15
Joined: 13 Oct 2023, 15:43

Re: Do not send "welcome" emails on first submission

Post by WWY »

Ah! But make that line the first in the function and EUREKA!

Problem solved. Thank you.
Post Reply