You need to sign in to do that
Don't have an account?
Demi Dev
Apex trigger that stops email from going out after a user record is created
So I found out that I cannot disable the automatic outgoing emails that is sent after a user record is created in Salesforce.
(We enables SSO in out environment, so it isn't necessary for the automatically generated email confirmation to be sent to users after they've been created in SF). Enetually, we'd like to sent out a custom email instead.
I was thinking to create a SF Apex rigger on the User object that somehow "deleted" the outbound email that is send after a user record is created.
Is this possible? Could someone assist with the code? I have very little experiece writing Apex triggers (but very eager to learn!)
(We enables SSO in out environment, so it isn't necessary for the automatically generated email confirmation to be sent to users after they've been created in SF). Enetually, we'd like to sent out a custom email instead.
I was thinking to create a SF Apex rigger on the User object that somehow "deleted" the outbound email that is send after a user record is created.
Is this possible? Could someone assist with the code? I have very little experiece writing Apex triggers (but very eager to learn!)
Hey Demi, thank you for your feedback. After researching more into your issue, I discovered that when a new user is created in Salesforce, there is a checkbox called "Generate new password and notify user immediately" located at the end of the page. If one unchecks this checkbox, the user should not receive an e-mail. This will have to be manually done each time.
I was trying to see if there was a way to automatically uncheck this checkbox and unfortunately, there doesn't seem to be a way to do this so far. Salesforce doesn't provide one the option to edit any of the fields on the User page layout and the API for the checkbox field doesn't appear in the user field in Setup which would be needed to write a trigger on it.
All Answers
The email is no longer needed because we have set up SSO.
I was hoping maybe I could set up a trigger on the outgoing email and just cancel the email. Or reroute the outgoing email from support@salesforce to a generic email address?
Hey Demi, thank you for your feedback. After researching more into your issue, I discovered that when a new user is created in Salesforce, there is a checkbox called "Generate new password and notify user immediately" located at the end of the page. If one unchecks this checkbox, the user should not receive an e-mail. This will have to be manually done each time.
I was trying to see if there was a way to automatically uncheck this checkbox and unfortunately, there doesn't seem to be a way to do this so far. Salesforce doesn't provide one the option to edit any of the fields on the User page layout and the API for the checkbox field doesn't appear in the user field in Setup which would be needed to write a trigger on it.